Imports Microsoft.Office.Interop.Word
Public Class Form1
Dim a As New Microsoft.Office.Interop.Word.Application
Dim lett(0 To 6) As String
Dim x As Integer
Dim i As Integer
Dim k As Integer
Dim m, n, b, v, c, z, formula As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ProgressBar1.Visible = True
ProgressBar1.Value = 0
i = 0
ListBox1.Items.Clear()
ListBox2.Items.Clear()
lett(1) = Mid(TextBox1.Text, 1, 1)
lett(2) = Mid(TextBox1.Text, 2, 1)
lett(3) = Mid(TextBox1.Text, 3, 1)
lett(4) = Mid(TextBox1.Text, 4, 1)
lett(5) = Mid(TextBox1.Text, 5, 1)
lett(6) = Mid(TextBox1.Text, 6, 1)
For q = 1 To 6
For w = 1 To 6
For r = 1 To 6
For t = 1 To 6
For y = 1 To 6
For u = 1 To 6
If Not (u = y Or u = t Or u = r Or u = w Or u = q Or y = t Or y = r Or y = w Or y = q Or t = r Or t = w Or t = q Or r = w Or r = q Or w = q) Then
formula = lett(t) & lett(y) & lett(u)
If ListBox1.Items.Contains(formula) = False Then
ListBox1.Items.Add(formula)
End If
formula = lett(r) & lett(t) & lett(y) & lett(u)
If ListBox1.Items.Contains(formula) = False Then
ListBox1.Items.Add(formula)
End If
formula = lett(w) & lett(r) & lett(t) & lett(y) & lett(u)
If ListBox1.Items.Contains(formula) = False Then
ListBox1.Items.Add(formula)
End If
formula = lett(q) & lett(w) & lett(r) & lett(t) & lett(y) & lett(u)
If ListBox1.Items.Contains(formula) = False Then
ListBox1.Items.Add(formula)
End If
Application.DoEvents()
End If
Next
Next
Next
Next
Next
Next
For Each d As String In ListBox1.Items
If ListBox2.Items.Contains(d) = False Then
If a.CheckSpelling(d) = True Then
ListBox2.Items.Add(d)
Application.DoEvents()
End If
End If
i = i + 1
x = (i * 100) / ListBox1.Items.Count
If x > 100 Then
x = 100
End If
ProgressBar1.Value = x
If ProgressBar1.Value = 100 Then
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)
ProgressBar1.Visible = False
End If
perc.Text = ProgressBar1.Value & "%"
par.Text = ListBox2.Items.Count
Next
End Sub
End Class