Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-27-2015, 06:22 AM
gmaxey gmaxey is offline How to create a special TOC in word document? Windows 7 32bit How to create a special TOC in word document? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You could create a style say called "SpecTOC" and apply it to you separator phrases. Then run:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
  Set oRng = ActiveDocument.Range
  oRng.Collapse
  
  With ActiveDocument
    .TablesOfContents.Add Range:=oRng, RightAlignPageNumbers:= _
      True, UseHeadingStyles:=False, IncludePageNumbers:=True, AddedStyles _
      :="SpecTOC,1", UseHyperlinks:=True, HidePageNumbersInWeb:=True, _
      UseOutlineLevels:=False
    .TablesOfContents(1).TabLeader = wdTabLeaderDots
    .TablesOfContents.Format = wdIndexIndent
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a special TOC in word document? How do I create an index of every word in a document? jbengal Word 5 11-23-2022 02:17 PM
How to create a special TOC in word document? How to Create Dynamic Paragraphs in Word Document gt7586d Word 3 02-19-2015 01:02 PM
How to create a special TOC in word document? Create a word document by answering questions? mattfrack Word 1 01-09-2015 02:25 PM
How to identify whether Word 2007 was used to create a document saved as Word 2003 noviceatwork Word 0 03-08-2012 06:40 AM
Creating a special Document darka5sa5sin Word 0 02-06-2009 11:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft