Passing strings to an ActiveX
Posted: Tue Aug 17, 2010 10:48 am
I'm trying to use the MS Fax ActiveX library to send a fax with attachements. The FaxDocument object has a bodies property defined as a Variant (http://msdn.microsoft.com/en-us/library ... S.85).aspx) which a string containing the file names of the documents to attach. when I call the putBodies method generated by Jade, passing in a string, I get a 0x80070057 (E_INVALIDARG) "The parameter is incorrect" exception.
Has anyone encountered this before when using ActivX interfaces / controls and if so is there a solution?
Has anyone encountered this before when using ActivX interfaces / controls and if so is there a solution?
Code: Select all
<< SNIP >>
create oFaxDocument transient;
oFaxDocument.createAutomationObject();
//Choose to attach the fax to the fax receipt
oFaxDocument.attachFaxToReceipt := true;
//Set the cover page type and the path to the cover page
oFaxDocument.coverPageType := CSMicrosoft_Fax_Service_Extend.CSFcptSERVER; // Server
oFaxDocument.coverPage := app.getProfileString( app.getIniFileName, INISectionCELFaxSettings, INIKeyFaxCoverPage, DefaultCoverPage );
oFaxDocument.sender.officePhone := app.getProfileString( app.getIniFileName, INISectionCELFaxSettings, INIKeyFaxPhone, null );
oFaxDocument.sender.faxNumber := app.getProfileString( app.getIniFileName, INISectionCELFaxSettings, INIKeyFaxNumber, null );
oFaxDocument.sender.name := app.getProfileString( app.getIniFileName, INISectionCELFaxSettings, INIKeyFaxSenderName, null );
//Set the fax priority
oFaxDocument.priority := CSMicrosoft_Fax_Service_Extend.CSFarSUBMIT_NORMAL;
//Set the receipt type to email
oFaxDocument.receiptType := CSMicrosoft_Fax_Service_Extend.CSFrtNONE;
//Specify that the fax is to be sent at a particular time
oFaxDocument.scheduleType := CSMicrosoft_Fax_Service_Extend.CSFstNOW; // now
//Name the document
oFaxDocument.documentName := self.class.name & ": Fax Report Output";
//Set the fax body
[i]oFaxDocument.putBodies( 'C:\temp\file1.pdf;C:\temp\file2.pdf' );[/i]
//Add the recipient with the fax number
oFaxDocument.celAddReceiptents( receipentsAddresses, receipentsNames );
//Provide the cover page note
oFaxDocument.note := message;
oFaxDocument.subject := subject;
oFaxDocument.connectedSubmit2( zMyFaxServer.getInterface( CSIFaxServer).CSIFaxServer, oOutgoingJobs);