F
fogharty
I'm working (still) on a Latin course.
One of the things I did was to copy and paste the original working Word
5 documents into Word 2004 as unformatted text so that I could insert
the correct Unicode characters. See original posts here.
<http://groups.google.com/group/micr...8c5b713ec?q=fogharty&rnum=11#ca5f0b18c5b713ec">
Of course, I lost all my formatting when I did this, all my bolding and
italics. Since all the Latin words need to be italicized, and my
document/dictionary thinks all these words are misspellings, I was
wondering if there was a way to write a macro to find all "misspelled"
words and format them.
I searched around these groups and the MVPS site, and found a few
macros that I thought I could adapt. Unfortunately I keep getting
syntax errors and I can't see what's wrong.
Can someone help me with the VBA script?
Thanks
=========================
Here is one script:
=========================
Sub latin_words()
'
' latin_words Macro
' Macro recorded 7/14/06 by fogharty
'
Dim spErr As Object
For Each spErr In ActiveDocument.Range.SpellingErrors
spErr.Font.Color = wdColorDarkRed
spErr.Font.Italic = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
=========================
Here is another:
=========================
Sub latin_words()
'
' latin_words Macro
' Macro recorded 7/14/06 by fogharty
'
Dim oWord As Range
Dim StoryRange As Range
For Each StoryRange In ActiveDocument.StoryRanges
Application.CheckSpelling Word:=StoryRange
For Each oWord In StoryRange.Words
If Not Application.CheckSpelling(Word:=oWord.Text) Then
oWord.HighlightColorIndex = wdYellow
End If
Next oWord
Next StoryRange
End Sub
One of the things I did was to copy and paste the original working Word
5 documents into Word 2004 as unformatted text so that I could insert
the correct Unicode characters. See original posts here.
<http://groups.google.com/group/micr...8c5b713ec?q=fogharty&rnum=11#ca5f0b18c5b713ec">
Of course, I lost all my formatting when I did this, all my bolding and
italics. Since all the Latin words need to be italicized, and my
document/dictionary thinks all these words are misspellings, I was
wondering if there was a way to write a macro to find all "misspelled"
words and format them.
I searched around these groups and the MVPS site, and found a few
macros that I thought I could adapt. Unfortunately I keep getting
syntax errors and I can't see what's wrong.
Can someone help me with the VBA script?
Thanks
=========================
Here is one script:
=========================
Sub latin_words()
'
' latin_words Macro
' Macro recorded 7/14/06 by fogharty
'
Dim spErr As Object
For Each spErr In ActiveDocument.Range.SpellingErrors
spErr.Font.Color = wdColorDarkRed
spErr.Font.Italic = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
=========================
Here is another:
=========================
Sub latin_words()
'
' latin_words Macro
' Macro recorded 7/14/06 by fogharty
'
Dim oWord As Range
Dim StoryRange As Range
For Each StoryRange In ActiveDocument.StoryRanges
Application.CheckSpelling Word:=StoryRange
For Each oWord In StoryRange.Words
If Not Application.CheckSpelling(Word:=oWord.Text) Then
oWord.HighlightColorIndex = wdYellow
End If
Next oWord
Next StoryRange
End Sub