Re: Using OLE-automation and Word97

From: W v A <wesselX_at_Xwau.mis.ah.nl>
Date: Wed, 1 Jul 1998 08:07:40 GMT
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 [Quoted]
>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

(Please remove X's from e-mail account when replying) Received on Wed Jul 01 1998 - 10:07:40 CEST

Original text of this message