Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Format Table of Contents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mmikedm1000 - 23 Nov 2005 00:05 GMT
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#)
Signature

Michael

Jonathan West - 23 Nov 2005 11:40 GMT
Hi Michael,

You need to set the format of styles TOC 1 to TOC 9. these define the layout
of the Table of Contents

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

>I am trying to edit my Table Of Contents (TOC).  I have recored a Macro
>that
[quoted text clipped - 22 lines]
> _
>        InchesToPoints(5#)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.