Re: Using OLE-automation and Word97

From: DanHW <danhw_at_aol.com>
Date: 2 Jul 1998 00:44:25 GMT
Message-ID: <1998070200442500.UAA16042_at_ladder01.news.aol.com>


>OLE-automation and Word97
>From: wesselX_at_Xwau.mis.ah.nl (W v A)
>Date: Wed, Jul 1, 1998 04:07 EDT
>Message-id: <EvEp0z.K2s_at_wau.mis.ah.nl>
>
>In article <1998070102343100.WAA14707_at_ladder01.news.aol.com>, danhw_at_aol.com
>(DanHW) wrote:
>>>Hi there,
>>>
>>>Has anybody used OLE-automation with Word97 yet?
>
><SNIP>
>
>>
>>YES I got it working!!! There was an article in the IOUG Select magazine
>that
>>explains it. In case you don't, I can recall the general process, and some
>of
>>the gotcha's. Hopefully it will be close enough so you can manage...(I'm
>doing
>>this from memory...).
>>
>>Look at the OLE2 package, and related help; it really is all there
>>
>>declare
>> application <I forget the data type...)
>> arglist <same comment...>
>>
>>begin
>> application := ole2.create_obj('word.basic');
>> ole2.createarg(arglist);
>> ole2.add_arg (arglist, 0);
>> ole2.add_arg(arglist, '');
>> ole2.invoke (application, 'FileNew',arglist);
>>
>> ole2.add_arg(arglist, 'my words');
>> ole2.invoke (application, 'insert', arglist);
>> ole2.destroyarg(arglist);
>>end;
>
><SNIP>
>
>>Good luck
>>
>>Dan Hekimian-Williams
>>
>>
>Dan,
>
>Thanks a lot for your reply.
>I've got it working !
>BUT : one big problem remains. Because I have an embedded
>Word-document, the only way to save it to disc is to activate the
>Word-object, then activate Word Basic and finally save it to disc
>using Word Basic commands.
>The problem is that whenever Word97 is already activated, the
>document opens in the active Word session, and the
>forms_ole.activate_server('Word.Basic') command opens another session.
>Now Word Basic looks at the 2nd. session and my document is in
>the 1st. session !
>This forces me to make sure that the user closes all active Word-sessions
>before saving documents from the Oracle database to the file-server.
>How I don't now.
>
>Thanks again,
>
>
>Wessel van Alphen
>
>

I am not doing it as an imbedded object; but as a separate application; for me the idea is to dump the records retrieved in the query into a Word document. I do not call the 'activate_server' call; I use the 'create_obj' call; so if I start my process once, then start it again, I DO get 2 copies of Word and each one has the appropriate data. My usage is a little different, so this is the expected/ preferred behavior (at least so far...)

In your situation, does the 'activate_server' call return an application id/handle? If so, you should be able to write to that one, and have it appear in the correct session.

Good Luck,

Dan Hekimian-Willams Received on Thu Jul 02 1998 - 02:44:25 CEST

Original text of this message