Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error calling MSWord function from a Powerbuilder application

Posted on 2003-12-04
4
Medium Priority
?
449 Views
Last Modified: 2007-12-19
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
ole_object_variable.mailmerge.opendatasource(...).
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...

iole_mergeto.MailMerge.OpenDataSource("c:\_junk.xls",la_zero,la_false,true,la_false,la_false,
la_nulstring,la_nulstring,la_false,la_nulstring,la_nulstring,"Entire Spreadsheet",la_nulstring,la_nulstring)

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.

Thanks,

0
Comment
Question by:Meena_kumari
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 250 total points
ID: 9880938
you used the long value for the subtype parameter? since i see a nullstring and not the value of the parameter in your connect string

if you record a macro connecting manually and compare the recorded string to the one you use can you make it work from there or not?
0
 

Author Comment

by:Meena_kumari
ID: 9881430
What I have shown was my current code , not the modified code. Currently we are not passing
[OpenExclusive], [SubType*] . [OpenExclusive] was there earlier but optional. And [SubType] is
the new argument for Word 2002. We were not passing value for [OpenExclusive] so far.
 
In the modified code I am passing boolean value for [OpenExclusive] and a string value for [SubType*])
 
Value passed for SubType is "wdMergeSubTypeWord2000"
 
I did not understand your Macro part. Can you please explain it once more.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 9884447
wdMergeSubTypeWord2000

has a value of long in word 2003 and the value passed is 8

so if you try to pass 8 instead of the string value what happens?
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Lost Word File? Eagerly, need it back? Read ahead; this File Recovery guide is for you.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question