Bookmarks in Word 2007

MattKnowles

New Member
I'm trying to insert/read values from bookmarks in Word 2007. I recorded the macro to do this and translated it into Progress code and got as far as:

define variable chWord as com-handle no-undo.
define variable chDoc as com-handle no-undo.
define variable chBookmark as com-handle no-undo.

create "Word.Application" chWord.
chWord:Documents:Open("c:\temp\test.docx").
chDoc = chWord:ActiveDocument.
chBookmark = chDoc:Bookmarks(1):select. /* Errors on this line */
chWord:quit(false,,).

When I run this I get the error "'Item' is not a property". What am I missing please?

Matt
 

WinningJr

New Member
chBookmark = chDoc:Bookmarks:ITEM(1).
chBookMark:select.

or just
chDoc:Bookmarks:ITEM(1):SELECT.
if you don't need the handle.

I would expect ITEM() to be zero based. The example I'm looking at actually passes a name in ITEM() instead of a number, so I'm not certain.
 
Top