mailmerge.destination in Word 2003

  • Thread starter Matthew Fitzgerald
  • Start date
M

Matthew Fitzgerald

We have a powerbuilder application that offers a mail
merge option using an OLE object and MSWord. It works in
versions of Word before Word 2003, but it does not work
in Word 2003. There is an error accessing the
property 'Destination' at the following line:

lo_ole_word.ActiveDocument.MailMerge.Destination=0

It is our understanding that zero = create new Word Doc
and 1 = send to printer. Has something changed in Word
2003?
 
C

Cindy M -WordMVP-

Hi Matthew,
We have a powerbuilder application that offers a mail
merge option using an OLE object and MSWord. It works in
versions of Word before Word 2003, but it does not work
in Word 2003. There is an error accessing the
property 'Destination' at the following line:

lo_ole_word.ActiveDocument.MailMerge.Destination=0

It is our understanding that zero = create new Word Doc
and 1 = send to printer. Has something changed in Word
2003?
No, at least not as far as this value is concerned. 0 is
still equal to the enum wdSendToNewDocument.

Does sending to the printer work, or do you get an error
with that, too? I'd be more inclined to say that perhaps the
ActiveDocument is not a valid merge document when this
command tries to execute...

One way to test what might be going on is to have the macro
stop just before this point, with the Word window visible
and active. Now try to execute the mail merge to a new
document manually (in the UI). Can you do that, or do you
get an error message? And is it more informative?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

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

Jeff Bean

We have a powerbuilder application that offers a mail
merge option using an OLE object and MSWord. It works in
versions of Word before Word 2003, but it does not work
in Word 2003. There is an error accessing the
property 'Destination' at the following line:

lo_ole_word.ActiveDocument.MailMerge.Destination=0

It is our understanding that zero = create new Word Doc
and 1 = send to printer. Has something changed in Word
2003?

I encountered the same problem. The MailMerge object is not getting
created because it couldn't open the data source. What is happening is
that Word wants to display the warning "Opening this document will run
the following SQL command..." but the message is suppressed because the
merge is being run via automation. So it acts as if the response to the
query was "no". To make this work you either have to turn off
DisplayAlerts or you have to make a registry tweak to suppress that
particular warning:

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

What's even more annoying is that I tested my application with the
public beta of Office 2003 and encountered no problems. This warning
and the resulting problems were added to the final release.

Jeff Bean
CWC Software
 

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