Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP, office 2003, and mail merge
Message
From
19/11/2004 08:23:17
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00959313
Message ID:
00962944
Views:
11
I have run into some issues automating the mail merge process with office 2003. When I attach the datasource to the mail merge document it pops up a window that forces me to select 'sheet1$`', 'sheet2$`', or 'sheet3$`'. The excel file I created uses only one sheet. A year ago there was a tip in foxpro advisor that corrected this issue for office xp. of course now this issue occurs in office 2003 and the fix for office xp does not work. any ideas? has anyone else run into this issue?

Is this the issue you are talking about?

PRB: Prompt to Select Table with Word 2002 Mail Merge Code for Excel or Access Data SourcePSS ID Number: 289830

SYMPTOMS
When you call the OpenDataSource method to connect a mail merge document to a Microsoft Excel or Microsoft Access data source with Word 2002, the Select Table dialog box appears. The same code, when used with Word 97 or Word 2000, runs without displaying a dialog box.
CAUSE
In Word 97 and Word 2000, if you use the path/file name for an Excel workbook or an Access database for the Name argument in the OpenDataSource method, Word uses Dynamic Data Exchange (DDE) to access the data for your mail merge, as follows:

RESOLUTION
To avoid the prompt, you can do the following:
Supply the SQLStatement argument of the OpenDataSource method with a valid SQL query. Word 2002 uses OLEDB (through ODSO) for the data access, whereas Word 97 and Word 2000 continue to use DDE. -or-


Force Word 2002 to use DDE instead of OLEDB for the data access by supplying the SubType argument of the OpenDataSource method with wdMergeSubTypeWord2000. Note that the SubType argument is new to Word 2002; Word 97 and Word 2000 do not support this argument.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform