Creating a TOC with \c switch

B

bigjisla

Hi all,

I am trying to create a Table of Contents with the \c switch, in the
form of e.g. {TOC \c TBC}; using VBA. However, when reading the VBA
help, the Add method to the TableOfContents object does not seem to
offer this possibility. Any help appreciated.

Regards,

Peter

[Word 2003, Windows XP]
 
S

Stefan Blom

One way would be to add the TOC field via a Fields collection:

ActiveDocument.Fields.Add Range:=Selection.Range _
, Text:="TOC \c TBC"

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
B

bigjisla

Hi Stefan,

works like a breeze, thanks a lot for the reply!

Regards,

Peter

One way would be to add the TOC field via a Fields collection:

ActiveDocument.Fields.Add Range:=Selection.Range _
, Text:="TOC \c TBC"

--
Stefan Blom
Microsoft Word MVP

I am trying to create a Table of Contents with the \c switch, in the
form of e.g. {TOC \c TBC}; using VBA. However, when reading the VBA
help, the Add method to the TableOfContents object does not seem to
offer this possibility. Any help appreciated.

[Word 2003, Windows XP]
 
S

Stefan Blom

Glad I could help.

--
Stefan Blom
Microsoft Word MVP


in message
Hi Stefan,

works like a breeze, thanks a lot for the reply!

Regards,

Peter

One way would be to add the TOC field via a Fields collection:

ActiveDocument.Fields.Add Range:=Selection.Range _
, Text:="TOC \c TBC"

--
Stefan Blom
Microsoft Word MVP

I am trying to create a Table of Contents with the \c switch, in the
form of e.g. {TOC \c TBC}; using VBA. However, when reading the VBA
help, the Add method to the TableOfContents object does not seem to
offer this possibility. Any help appreciated.

[Word 2003, Windows XP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top