Retrieval of information from Word document

N

Nick Wright

Good day

I have created a word 2000 template with a variety of
bookmarks. I use MSAccess 2002 to fill this document out
using automation. My problem is using MSAccess to pull
certain information back from the document.

I find the bookmark, but cannot seem to get the
information back into a variable in Access. I find the
bookmark and then try to set a variable = the value.
Should I be using the .range of the bookmark or just
the .text?

Maybe if someone could give me an example of this being
done this will help me over this hurdle.

Thanx in anticipation

Nick
 
J

Jonathan West

Hi Nick

You need something like this

strText = objWord.ActiveDocument.Bookmarks("MyBookmark").Range.Text

where
strText is a string variable
objWord os an object variable pointing to Word
"MyBookmark" is the name of the bookmark in the current document whose text
you want to retrieve.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

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