Is there a way to programmatically open a word document to a specific section?

M

Mike Legako

Hi Word Gurus,
I am a Microsoft Visual C++ programmer. I use Word to document how my
programs work, but I would like to use it as my on-line help as well.
Therefore my question: Is there a way to programmatically open a Word
document to a specific section?

I have the O'Reilly book on Word Macros, but 1) It focuses on VBA, and
2) It doesn't seem to address this issue, which is not how to
programmatically do something once a Word document is open, but instead is
how to get it open to a specific page in the first place!

I find myself wondering if Word can take any kind of command line
arguments?

Mike
 
M

Mike Legako

Hi Word Gurus (again),
Is it possible to use VBA to add a command line interface to word that
could open a word document to a specified page or section?
Mike
 
M

mpt

You can create a hyperlink to do that but I suspect you are looking for
something else, yes?

Richard
 
B

Bengt Carlsson

If you create a bookmark in the document, you probably can write some
code lines that says 1.) open the doc 2.) goto bookmark
That is what I have done from Access in VBA anyhow.

/Bengt
 
H

Howard Kaikow

Mike Legako said:
Hi Word Gurus,
I am a Microsoft Visual C++ programmer. I use Word to document how my
programs work, but I would like to use it as my on-line help as well.
Therefore my question: Is there a way to programmatically open a Word
document to a specific section?

I have the O'Reilly book on Word Macros, but 1) It focuses on VBA, and
2) It doesn't seem to address this issue, which is not how to
programmatically do something once a Word document is open, but instead is
how to get it open to a specific page in the first place!

I find myself wondering if Word can take any kind of command line
arguments?

You can use C++ to create a Word object and use vba via the Word object.
Via the Word object, you can then first Open the doc and then go to a
bookmarked location, or navigate to where you wish.
 

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