Re: Forms 4.5, OLE and Word97 bookmarks
Date: Sun, 17 Jan 1999 23:43:30 GMT
Message-ID: <77tsj1$c4i$1_at_nnrp1.dejanews.com>
Hi Charles,
Thanks for your reply. Unfortunately, I've had a few problems trying to implement it! I have Forms version 4.5.8 and I'm unable to find the OLE importer which you mention in your reply.
Also, my Forms compiler doesn't like the OLEVar type, or Create_Var and Set_Var procedures! It also splutters at the use of Word_Bookmarks and Word_Bookmark packages, but as you say, these must be obtained from Forms' (missing) OLE importer.
Let me know if I'm doing something wrong...
Neil W. Garside (Brisbane, Australia)
In article <369e6dfc.29502955_at_ra.nrl.navy.mil>,
erwincs_at_eglin.af.mil (SSgt Charles Erwin) wrote:
> On Tue, 12 Jan 1999 23:10:35 GMT, nwgarside_at_my-dejanews.com wrote:
>
> >
> > DECLARE
> > 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
> >
>
> It looks like you already have the bookmarks collection object, so the
> following is based on what you already have above. Enjoy!
>
> Note: The Word_Bookmarks and Word_Bookmark packages are obtained from
> the OLE importer in Forms.
>
> declare
> vobjBookmark OleObj;
> vvarIndex OleVar;
> vstrName VARCHAR2(256);
> /* Index of the bookmark in the bookmarks collection */
> viIndex NUMBER := 1;
> begin
> vvarIndex := Create_Var;
> Set_Var( vvarIndex, viIndex );
> vobjBookmark := Word_Bookmarks.Item(objBookmarks, vvarIndex);
> vstrName := Word_Bookmark.Name( vobjBookmark );
> end;
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Jan 18 1999 - 00:43:30 CET