B
BRC
I tried the following code to try to populate a listbox with spelling
errors. I found the code on the web.
I am getting an "object required" error at the " For n = 0 To
UserForm1.ListBox1.ListCount - 1" line.
using word 2003
Sub mySpelling()
Dim mySpellingError
Dim n As Long
Dim myFlag As Boolean
For Each mySpellingError In ActiveDocument.Range.SpellingErrors
myFlag = False
For n = 0 To UserForm1.ListBox1.ListCount - 1
If UserForm1.ListBox1.List(n) = mySpellingError.Text Then
myFlag = True
Next
If myFlag = False Then
UserForm1.ListBox1.AddItem mySpellingError.Text
End If
Next
UserForm1.Show
End Sub
Thanks for any help
errors. I found the code on the web.
I am getting an "object required" error at the " For n = 0 To
UserForm1.ListBox1.ListCount - 1" line.
using word 2003
Sub mySpelling()
Dim mySpellingError
Dim n As Long
Dim myFlag As Boolean
For Each mySpellingError In ActiveDocument.Range.SpellingErrors
myFlag = False
For n = 0 To UserForm1.ListBox1.ListCount - 1
If UserForm1.ListBox1.List(n) = mySpellingError.Text Then
myFlag = True
Next
If myFlag = False Then
UserForm1.ListBox1.AddItem mySpellingError.Text
End If
Next
UserForm1.Show
End Sub
Thanks for any help