Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word MailMerge - Office 2000 vs Office XP w/ VFP 6
Message
From
23/01/2002 11:39:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word MailMerge - Office 2000 vs Office XP w/ VFP 6
Miscellaneous
Thread ID:
00609065
Message ID:
00609065
Views:
77
I am doing MailMerge into a Word document (Office 2000) and everything works. I do the same thing into Word XP and an error occurs attaching the DataSource. I have used objbect browser and Macro recorder and everything LOOK the same.

There are 2 additional Parameters in Office XP [OpenExclusive], [SubType]
However; when recording the MACRO in Word XP I do not see the parameter set.

Could this be a service pack Issue, I do not know if one is insatlled or not.

Any suggestions?

****************
**Sample Code *
****************
wdOpenFormatAuto = 0
lcTableName = "C:\Test.dbf"
cDSN = "DSN=FoxPro Files - Word;UID=;PWD=;"
cSourceDB = "SourceDB=C:\;"
cSourceType = "DBF;"
cOther = "Exclusive=No;BackgroundFetch=No;Collate=MACHINE;Null=Yes;Deleted=Yes;"
cSelect = "SELECT * FROM "+lcTableName

oWord = CreateObject("Word.Application")
oWord.ActiveDocument.MailMerge.MainDocumentType = 0 && wdFormLetters
oWord.ActiveDocument.MailMerge.OpenDataSource(lcTableName,wdOpenFormatAuto,,,;
,,,,;
,,,;
cDSN+cSourceDB+cSourceType+cOther,;
cSelect)
Next
Reply
Map
View

Click here to load this message in the networking platform