Access 97 : Bookmark in word document

M

Monkeytoo

Is it possible (with VBA code from an access application) to know if a
bookmark exist in a word document (.dot) ?
 
J

John Vinson

Is it possible (with VBA code from an access application) to know if a
bookmark exist in a word document (.dot) ?

Yes. You'll need to launch Word using automation, e.g.

Dim objWord As Object
Set objWord = New Word.Application
objWord.Documents.Add "C:\My Documents\xyz.DOT"
Debug.Print objWord.ActiveDocument.Bookmarks.Count

or loop through the Bookmarks object's Item collection looking for the
name of the bookmark.
 

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