Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need Word 2007 openDataSource help
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01332346
Message ID:
01332808
Views:
8
My issue is (I think???), I have used 2 datasources in the past (2000, 2003) to produce this memo. I used a headersource and datasource for the top of the memo and inserted a table query for the bottom of the memo. Word2007 broke that. It appears I have to use one odc file to attach one datasource. The code below was my attempt to open the datasource directly, using an odc file...in my dreams I guess!

Is there a way to use 2 different datasources with 1 doc in word 2007?

>>This is the code I use to TRY to start a mailmerge. I do not want to use wizard to attach data, rather merge data on the fly. I looked at Marcia Atkins white paper but it is a little confusing. Here is the code. Her example shows "Entire Spreadsheet" for the connection parameter. Is that right? I am also getting an error "type mismatch". What am I missing?
>>
>>oWord=GETOBJECT('','word.application')
>>oDoc=oWord.Documents.Open("filePath+docName")
>>oDoc.MailMerge.OpenDataSource("dbfPath+dbfName", 0, 0, 1, 0, "", "", 0, "", "", "Entire Spreadsheet", "", "" )
>>
>
>I saw you use variables, but you don't need to round them in quotes, so:
>
>oWord = GETOBJECT('','word.application')
>oDoc  = oWord.Documents.Open(filePath+docName)
>oDoc.MailMerge.OpenDataSource(dbfPath+dbfName, 0, 0, 1, 0, "", "", 0, "", "", "Entire Spreadsheet", "", "" )
>
>
>DBF?
>I just saw that you use DBF for DataSource, is that right?
Extreme Programming = Plan -> Design -> Code -> Test
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform