[dba-Tech] List Word Bookmarks in a Document

Bryan Carbonnell carbonnb at gmail.com
Thu Aug 18 12:45:35 CDT 2005


On 18/08/05, Arthur Fuller <artful at rogers.com> wrote:
> How can I do this? I would like to do it from Access, by opening the
> template and listing the bookmarks in the Access immediate window.

Here is a snippet that will do it for you. Just remember to set doc to
your document, either by opening it

Set doc = Documents.Open("d:/Full/Path/to/your.doc")

or creating a new doc based on a template

Set doc = Documents.Add("d:/Full/Path/to/your.dot")


Dim bmk As Bookmark

For Each bmk In doc.Bookmarks
  Debug.Print bmk.Name
Next


-- 
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well
preserved body, but rather to skid in sideways, totally worn out,
shouting "What a great ride!"



More information about the dba-Tech mailing list