Using the bookmark functionality in the Word API

U

USP45

Anyone know how to use it? Are there any good resources/
documentation?

Specifically we're looking for how to automate adding bookmarks (links
to different sections of the same document) using the API.

We're using perl wrapped in a dos batch program.
 
S

Shauna Kelly

Hi

As a general step, I suggest that you use the MacroRecorder that is
built in to Word. It often gives you a good idea of what objects and
methods you'll need. For more information, see

Creating a macro with no programming experience using the recorder
http://www.word.mvps.org/FAQs/MacrosVBA/UsingRecorder.htm
and
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm
How to modify a recorded macro

Having recorded your macro and examined the code, you'll see that the
two key things you need are the Bookmarks collection (and individual
Bookmark objects) and the InsertCrossReference method. Look up both in
VBA help for details.

The only tricky bit is the InsertCrossReference method. It can be
difficult when creating cross-references to numbered paragraphs. But,
you're in luck: creating a cross-reference to a bookmark is straight
forward. Just look up the help to get the parameters you need.

Post back if you need specific information and let us know what version
of Word you're using.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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