Forms 4.5 and OLE2 automation of Word

From: Scott Dart <scott-dart_at_uiowa.edu>
Date: 1997/04/18
Message-ID: <01bc4c0b$f973d340$b048ff81_at_Scott-Dart.int-med.uiowa.edu>#1/1


Maybe someone here can help me with this. I have the following code which opens MS word, opens a specific template, then saves the template out as a given filename:

application := OLE2.CREATE_OBJ('Word.Basic'); OLE2.INVOKE(application,'AppShow');
args :=OLE2.CREATE_ARGLIST;

OLE2.ADD_ARG(args,file_open);
OLE2.INVOKE(application,'FileOpen',args);
OLE2.DESTROY_ARGLIST(args);

args :=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args,saveas);
OLE2.INVOKE(application,'FileSaveAs',args);
OLE2.DESTROY_ARGLIST(args);
OLE2.RELEASE_OBJ(application);

can anyone help me modify this code so that if word is already open, it will use the copy of word that is already running, instead of opening a new copy of word?

thanks

scott-dart_at_uiowa.edu Received on Fri Apr 18 1997 - 00:00:00 CEST

Original text of this message