Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

word OLE

Status
Not open for further replies.

carolinaof

Programmer
Oct 1, 2001
26
0
0
BR
I am trying to edit a word document replacing bookmarks. The following code is opening the document, wich is an embedded databease item OLE, but the gotos and inserts are not working. In my tests with an independently executing word application, the inserts work, but the gotos to the bookmarks don't. What am I doing wrong?

DECLARE
application OLE2.OBJ_TYPE;
args OLE2.LIST_TYPE;
BEGIN
FORMS_OLE.ACTIVATE_SERVER('DOC');
application:=OLE2.CREATE_OBJ('Word.Basic');

FORMS_OLE.EXEC_VERB('DOC',1);

args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'EmployeeName');
OLE2.INVOKE(application, 'EditGoto', args);
OLE2.DESTROY_ARGLIST(args);

args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'Carol Johnson');
OLE2.INVOKE(application, 'Insert', args);
OLE2.DESTROY_ARGLIST(args);

args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:\TEMP\LETTER1.DOC');
OLE2.INVOKE(application, 'FileSaveAs', args);
OLE2.DESTROY_ARGLIST(args);

OLE2.INVOKE(application, 'EditUndo');
OLE2.INVOKE(application, 'EditUndo');

OLE2.RELEASE_OBJ(application);

FORMS_OLE.CLOSE_SERVER('DOC');
END;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top