Re: ole2 package in forms

From: michael ringbo <mri_at_dde.dk>
Date: 1998/01/20
Message-ID: <34C4A9B1.E904AD10_at_dde.dk>#1/1


Hi,

We had the same problem. This is what we did:

 v_doc_obj := ole2.create_obj('word.document.8');  v_app_obj := ole2.get_obj_property(v_doc_obj,'Application');

The first line creates a new document. That is, if Word is running: Create a new document, if Word is not running: Start Word, and create a new document.

v_doc_obj and v_app_obj now gives you the pointers to the two objects: The document and the application.

Michael Ringbo
mri_at_dde.dk

Lisa Davies wrote:

> Hi, I wonder if someone can help me.
> I have a form which uses the ole2 package to communicate with
> Microsoft
> Word 97. I am starting Word using
>
> word_inst := ole2.create_obj('Word.Application')
>
> My problem is this: if Word is already running on the user's machine,
> I want the form to use the one that is running rather than starting
> up a new copy. I am sure this must be commonly requested by other
> users of the ole2 package. I had it working when we were using
> Word for Office 95 - when Word made use of Word Basic and I had
>
> word_inst := ole2.create_obj('Word.Basic')
>
> If Word was already running this would just "connect" to that copy of
> Word.
>
> Any help would be most appreciated.
>
> Lisa
>
> Lisa Davies
> Computer Management
> email : lisa_at_cm.co.za
Received on Tue Jan 20 1998 - 00:00:00 CET

Original text of this message