mailmerge trouble after upgrading Word

K

KZeeh

I have a Visual FoxPro app with a mailmerge in it, working fine for several
years under Win2000 and Office 2000. A few people got upgraded to XP and
Office 2002 or 2003. Now the mailmerge does not work for only them. Here is
the code that works on the Win2000/Office2000 machines and not on the
upgraded ones.
**********************************************************
use c:\kelly\wordtest\tmpdec in 0 && datasource
select tmpdec
oWord = CREATEOBJECT('Word.Application')
oWord.WindowState = 2 && wdWindowStateMinimize
oDoc = oWord.Documents.Open("c:\kelly\wordtest\decision.doc")
oDoc.MailMerge.Destination = 0 && wdSendToNewDocument
oDoc.MailMerge.Execute
oWord.Documents(1).Activate
oWord.WindowState = 1 && wdWindowStateMaximize
oDoc.Close
**********************************************************
The error on these machines is "This method or property is not available b/c
the current mail merge main document needs a data source..." This crashes on
the Mailmerge.execute line. But there is a datasource, populated with data
and it works fine on the old machines.
Any insight????? Thank you so much for any ideas at all -I am tearing my
hair out here...
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?S1plZWg=?=,

Most likely, you're dealing with the issue described in this article. You'll
either need to have the users change the Registry setting, or you'll have to use
the OpenDataSource method to link in the data after the document has opened.

"Opening This Will Run the Following SQL Command" Message When You Open a Word
Document - 825765
http://support.microsoft.com?kbid=825765
I have a Visual FoxPro app with a mailmerge in it, working fine for several
years under Win2000 and Office 2000. A few people got upgraded to XP and
Office 2002 or 2003. Now the mailmerge does not work for only them. Here is
the code that works on the Win2000/Office2000 machines and not on the
upgraded ones.
**********************************************************
use c:\kelly\wordtest\tmpdec in 0 && datasource
select tmpdec
oWord = CREATEOBJECT('Word.Application')
oWord.WindowState = 2 && wdWindowStateMinimize
oDoc = oWord.Documents.Open("c:\kelly\wordtest\decision.doc")
oDoc.MailMerge.Destination = 0 && wdSendToNewDocument
oDoc.MailMerge.Execute
oWord.Documents(1).Activate
oWord.WindowState = 1 && wdWindowStateMaximize
oDoc.Close
**********************************************************
The error on these machines is "This method or property is not available b/c
the current mail merge main document needs a data source..." This crashes on
the Mailmerge.execute line. But there is a datasource, populated with data
and it works fine on the old machines.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top