M
mmikedm1000
I am trying to edit my Table Of Contents (TOC). I have recored a Macro that
will find the TOC which is the only text in the document as Style hyperlink.
I have tried to search and hightlight all styles with hyperlink and than
change the tab. Could someone look at this code and inform me where I went
wrong.
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Hyperlink")
With Selection.Find
.Text = "*"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.ParagraphFormat.TabStops(InchesToPoints(3.47)).Position = _
InchesToPoints(5#)
will find the TOC which is the only text in the document as Style hyperlink.
I have tried to search and hightlight all styles with hyperlink and than
change the tab. Could someone look at this code and inform me where I went
wrong.
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Hyperlink")
With Selection.Find
.Text = "*"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.ParagraphFormat.TabStops(InchesToPoints(3.47)).Position = _
InchesToPoints(5#)