Automating Table Of Contents - MailMerge (Word 2003)

A

Amrish

Hi,
I am using Microsoft Word 2003, and i am performing various
mail merge activities on an existing .dot file using C#. And after is insert
files using c# code, i need to update the existing Table Of Contents which is
present in the Template.

The macro code which is executed when we update the TOC is
something like WordBasic.UpdateTableOfContents. I am unable to do something
similar.

I also need to format the TOC like changing the color and font
of the TOC. And to do it, i need to select the TOC. It should be something
like TableOfContents.Range.Select(), but i am unable to get a similar syntax.
Is there any other way to do it?

-Amrish
 
A

Amrish

Had actually got the answer.
Its
(ActiveWordDocument).TablesOfContents[1].UpdatePageNumbers(); to update the
TOC
&
(ActiveWordDocument).TablesOfContents[1].Range.Select(); to Select it.
-Amrish
 

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