Creating bookmarks automatically via visual basic and word 2000

L

larryfergy

I have a documents directory that consists of word documents and a table of
contents that relate to those documents. So I thought I would create
bookmarks as they relate in the table of contents. Then create adobe acrobat
pdf from that.

I inntially was using macros but found I would have edit forever, so I
thought why not use visual basic.
I thought I could search for table of contents item and then add a bookmark,
but the search apparently doesn't return an address :

Set myRange = ActiveDocument.Content
myRange.Find.Execute FindText:="Visual Basic 6.0 versus Other Versions of
Visual Basic", Forward:=True


I can create bookmarks via visual basic via :

Set myDoc = Documents("Class 1 with bookmarks.doc")
myDoc.Bookmarks.Add Name:="V_B6_versus_Other_Versions_of_VB", _
Range:=myDoc.Paragraphs(3).Range
myDoc.ActiveWindow.View.ShowBookmarks = True


But thats a bookmark to nothing.

How do you access the document and scroll thruugh it via visual basic?
 
W

Word Heretic

G'day "larryfergy" <[email protected]>,

MyDoc.TablesOfContents(1).Range

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


larryfergy reckoned:
 

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