Forms 4.5, OLE and Word97 bookmarks

From: <nwgarside_at_my-dejanews.com>
Date: Tue, 12 Jan 1999 23:10:35 GMT
Message-ID: <77gkp2$a93$1_at_nnrp1.dejanews.com>



Does anyone have experience of calling (via OLE) Word97 VBA functions from a Forms 4.5 application?

I have a Forms 4.5 application from which I am creating a Word97 document based on a template which has a number of bookmarks. Part of my application retrieves a list of all the bookmarks in the template. I can get a count of the bookmarks by using the following PL/SQL:

  DECLARE

[Quoted]     objActiveDoc	OLE2.OBJ_TYPE;
    objBookmarks	OLE2.OBJ_TYPE;
    objBookmark    	OLE2.OBJ_TYPE;
    numBookmarkCount 	NUMBER;
  BEGIN
    objActiveDoc     := OLE2.GET_OBJ_PROPERTY(Word.hApp, 'ActiveDocument');
    objBookmarks     := OLE2.GET_OBJ_PROPERTY(objActiveDoc, 'Bookmarks');
    numBookmarkCount := OLE2.GET_NUM_PROPERTY(objBookmarks, 'Count');     Message('There are '||TO_CHAR(numBookmarkCount)||' bookmarks.');   END; However, I have a problem when I try and retrieve the name of each individual bookmark. The Word97 VBA I'm trying to PL/SQL'ise is:

  strBookmarkName = ActiveDocument.Bookmarks(intBookmarkCount).Name

...which I cannot do as I don't know how to get Forms to issue a VBA command
where the argument is positioned *before* the method I'm trying to invoke. The following VBA command to check whether a bookmark exists is simple to emulate:

  numBookmarkExists = ActiveDocument.Bookmarks.Exists("MyBookmark")

...as the argument is positioned *after* the Exists method. Can anyone tell
me how to emulate a VBA command where the argument is specified before the method?

Thanks for any help you can offer...

Neil W. Garside

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Jan 13 1999 - 00:10:35 CET

Original text of this message