On Apr 12, 2:16=A0pm, Lene Fredborg
wrote:
> As i understand your description, you only want to apply highlight to
> footnote text. If that is correct, I think the following macro will do the=
> job:
>
> Sub Footnotes_ApplyYellowHighligtToBoldText()
>
> =A0 =A0 Dim oRange As Range
>
> =A0 =A0 'Stop if no footnotes found
> =A0 =A0 If ActiveDocument.Footnotes.Count =3D 0 Then
> =A0 =A0 =A0 =A0 MsgBox "No footnotes found."
> =A0 =A0 =A0 =A0 Exit Sub
> =A0 =A0 End If
>
> =A0 =A0 Set oRange =3D ActiveDocument.StoryRanges(wdFootnotesStory)
>
> =A0 =A0 With oRange.Find
> =A0 =A0 =A0 =A0 .ClearFormatting
> =A0 =A0 =A0 =A0 .Font.Bold =3D True
> =A0 =A0 =A0 =A0 Do Until .Execute =3D False
> =A0 =A0 =A0 =A0 =A0 =A0 oRange.HighlightColorIndex =3D wdYellow
> =A0 =A0 =A0 =A0 Loop
> =A0 =A0 End With
>
> =A0 =A0 'Clean up
> =A0 =A0 Set oRange =3D Nothing
>
> =A0 =A0 MsgBox "Finished."
> End Sub
>
> --
> Regards
> Lene Fredborg
> DocTools - Denmarkwww.thedoctools.com
> Document automation - add-ins, macros and templates for Microsoft Word
>
>
>
> "andreas" wrote:
> > Dear Experts:
>
> > Is it possible to highlight (e.g. HighlightColorIndex =3D wdYellow) all
> > characters/words that have been formatted bold (either through manual
> > formatting or through appyling a user-defined character style) in
> > footnotes by using VBA.
>
> > Help is appreciated.
>
> > Thank you very much in advance.
>
> > Regards, Andreas- Hide quoted text -
>
> - Show quoted text -
Hello Lene,
thank you very much. Very nice coding. It is working as desired.
Thank you. Regards, Andreas