wdSendtoNewDocument error on mailmerge in word2003

D

DavidC

hi, got a program which is doing a mailmerge,
the system i wrote and first tested it on was a win xp machine and word xp
(2002),
BUT it does not work on a xp machine with word 2003!!!!
the line it goes wrong on is the ***wdSendToNewDocument***

DOES ANYONE HAVE ANY IDEAS????

the program:

Dim wordapp As New Word.Application
Set wordapp = CreateObject("Word.Application")

wordapp.ActiveDocument.Mailmerge.Destination = wdSendToNewDocument
wordapp.ActiveDocument.Mailmerge.Execute


The code is on a button.

Many Thanks
Dave
 
P

Peter Jamieson

You would get this error if
a. your code starts with a document that is not a mail merge main document
(e.g. ActiveDocument.MailMerge.MainDocumentType is set to
wdNotAMergeDocument) and
b. you are not setting the MainDocumentType explicitly, and
c. you are using a code sequence such as

ActiveDocument.MailMerge.OpenDataSource Name:=whatever...
ActiveDocument.MailMerge.Destination = whatever
ActiveDocument.Execute

and

d. you are not trapping errors in the OpenDataSource and
e. the OpenDataSource fails.

In Word 2003, (e) is more likely to happen because of the additional
security popups warning you about SQL.

If that is what is happening, you may need to look at

http://support.microsoft.com?kbid=825765
 

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