I'm trying to create a Word 2k macro that locates a paragraph based on the left indent as well as the font formatting, and then changes the style. Unfortunately, the Find fails, so the Find.Execute commands are applied to the currently selected paragraph. Code as follows:
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = "Arial"
.Font.Size = 10
.Font.Bold = True
.Font.Color = RGB(0, 128, 0)
.ParagraphFormat.LeftIndent = 0.56
End With
Selection.Find.Execute
Selection.ParagraphFormat.Style = "Heading 2"
Selection.MoveDown Unit:=wdLine, Count:=1
I'm new at this (obviously) so any help will be appreciated. Also, I would love to have the macro change the styles throughout the entire document and stop when it reaches the end of the document.
AJ
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = "Arial"
.Font.Size = 10
.Font.Bold = True
.Font.Color = RGB(0, 128, 0)
.ParagraphFormat.LeftIndent = 0.56
End With
Selection.Find.Execute
Selection.ParagraphFormat.Style = "Heading 2"
Selection.MoveDown Unit:=wdLine, Count:=1
I'm new at this (obviously) so any help will be appreciated. Also, I would love to have the macro change the styles throughout the entire document and stop when it reaches the end of the document.
AJ