Error calling MSWord function from a Powerbuilder application
Posted on 2003-12-04
A Word document is stored in a Oracle database as blob.
It is retrieved during run time into a Blob variable and then assigned to a OLE control (OLE_1.Objectdata = Blob variable).
Then we declare a local variable of type "oleobject" and is initiated by OLE_1.object ( ole_object_variable = ole_1.object)
Now onwards we use the local "oleobject" variable to execute MSword methods(functions) like
MS Excel spread sheet is used as data source.
We are NOT using "create" and "ConnectToObject" functions.
This setup was working fine with older versions of MSWord & MS Excel.
Opendatasource function description ...
Ole_object.MailMerge.OpenDataSource(Name As String, [Format], [ConfirmConversions], [ReadOnly], [LinkToSource], [AddToRecentFiles], [PasswordDocument], [PasswordTemplate], [Revert], [WritePasswordDocument], [WritePasswordTemplate], [Connection], [SQLStatement], [SQLStatement1], [OpenExclusive], [SubType*])
Our current code...
As per MS web site, to make this function work (in word2002) as before we need to pass a new parameter "SubType". They have given the value to be passed for that. But when I do, I get run time error "Illegal parameter passed..." .
Sometime it just says "Error calling External function..."
We are using PB 6.5, Win XP and Office XP.
I highly appreciate your any suggestions which helps me solve this critical, long standing issue.