Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word 2002 Mailmerge w/Excel Exception Error
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word 2002 Mailmerge w/Excel Exception Error
Miscellaneous
Thread ID:
00951050
Message ID:
00951050
Views:
44
Hi. I have a program that opens word via automation and merge data from an Excel file. ODBC Connection information is stored in the document. When I run the oDocument.MailMerge.Execute() command, Word generate an exception error: ...document is not a mail merge main document. If I open the same document directly from Word 2002 a popup message shows up asking me if I want to run the sql statement for the mail merge. If answer 'yes' document opens fine.
What could be the problem with the automation?

Word: 2002
OS: XP Pro
RELEASE ALL LIKE o*
LOCAL oDocument
PUBLIC oWord
oWord = CreateObject("Word.Application")
oWord.Visible = .t.
oDocument = oWord.Documents.Open("MailMerge.doc")
oDocument.MailMerge.Execute()
Reply
Map
View

Click here to load this message in the networking platform