Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word MailMerge - Office 2000 vs Office XP w/ VFP 6
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)
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement