J
John in Toronto
I am relatively new to VBA.
I want my macro to search for "Heading 2" but each time it runs additional
formatting is added, and the style is not found. I recorded the macro, and
left the default settings:
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 2")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
When I look at the find dialog, it shows:
Style: Heading 2, Border: Top: (Single solid line, Auto, 0.75 pt Line
Width)...
I have tried using different templates too.
Any help would be appreciated.
Thanks
John
I want my macro to search for "Heading 2" but each time it runs additional
formatting is added, and the style is not found. I recorded the macro, and
left the default settings:
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 2")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
When I look at the find dialog, it shows:
Style: Heading 2, Border: Top: (Single solid line, Auto, 0.75 pt Line
Width)...
I have tried using different templates too.
Any help would be appreciated.
Thanks
John