Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Calling Word OLE method with multiple arguments

 I am writing a script in DXL which needs to send 2 arguments to a Word function.  I assume that the arguments need to be sent (or "put") in the order they appear in the function's definition.  When I run the OLE method, however, I keep getting the following error message:

OLE problem: , OLE error code: -2147352562
I have been trying to figure out what this error code means, but have yet to find this exact error number.  Here is the DXL code I'm using to run the macro:
objWord = oleCreateAutoObject("Word.Application");

if(null objWord)
     errorBox("Unable to open word application");

//Open the docm file, insert contents of newly created HTML file and save as .doc
olePut(objWord, "Visible", true);
oleGet(objWord, "Documents", objDocs);
put(autoArgs, sHTMLFileName);
oleMethod(objDocs, "Open", autoArgs, objDoc);

put(macroArgs, nameOfMacro);
put(macroArgs, CMG_USER_DESKTOP);
put(macroArgs, sLastBL);

sErrorMess = oleMethod(objWord, "Run", macroArgs);
if (!null sErrorMess) infoBox(sErrorMess);

And the function in Word is:
Sub SaveHTMLAsDoc(sPath As String, sBaseline As String)

Am I adding the arguments in the wrong order? It would be GREATLY appreciated if someone knows how to fix this problem I've had for quite some time.


Chris


0 votes



One answer

Permanent link
Hi,

I am reasonably sure that this is not a question that this forum can answer.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 4

Question asked: Jul 07 '21, 2:51 p.m.

Question was seen: 1,047 times

Last updated: Jul 08 '21, 7:19 a.m.

Confirmation Cancel Confirm