It's all about the answers!

Ask a question

Calling Word OLE method with multiple arguments


Christopher Cote (1516) | asked Jul 07 '21, 2:51 p.m.
edited Jul 08 '21, 7:19 a.m. by Fariz Saracevic (904613)

 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


One answer



permanent link
Ralph Schoon (63.1k33645) | answered Jul 08 '21, 2:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

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

Your answer


Register or 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.