Word97 macro in Word2002

M

Marty

I have a Word97 macro. In it I have the following lines of code to connect to
a database:

WordBasic.MailMergeMainDocumentType 0
WordBasic.MailMergeOpenDataSource Name:="", ConfirmConversions:=0,
ReadOnly:=0, LinkToSource:=0, AddToMru:=0, PasswordDoc:="", PasswordDot:="",
Revert:=0, WritePasswordDoc:="", WritePasswordDot:="",
Connection:="DSN=GAVURAH;UID=sa;PWD=;APP=Microsoft
Query;WSID=SHIVAINDRA;LANGUAGE=us_english;DATABASE=lp_patents",
SQLStatement:="execute splp_lppci_US " & Chr(34) & OrderLetterNumber &
Chr(34), SQLStatement1:=""
WordBasic.MailMerge CheckErrors:=1, Destination:=0, MergeRecords:=0,
From:="", to:="", Suppression:=0, MailMerge:=1, MailSubject:="",
MailAsAttachment:=0, MailAddress:=""

This works fine on our Word97 machines, but on the Word2002 machines the
macro breaks down and asks for the to connect to a data base.

What (if anything) can be done to correct this?

Thanks.

-Marty
 
C

Cindy M -WordMVP-

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

The connection methods changed starting in Word 2002, so you need separate
macros from this version onwards. I recommend recording making a connection in
Word 2002. To get an ODBC connection, activate "Confirm conversions on open" in
Tools/Options/General. After selecting the data source, you should get a list of
connection methods where you can choose ODBC.
I have a Word97 macro. In it I have the following lines of code to connect to
a database:

WordBasic.MailMergeMainDocumentType 0
WordBasic.MailMergeOpenDataSource Name:="", ConfirmConversions:=0,
ReadOnly:=0, LinkToSource:=0, AddToMru:=0, PasswordDoc:="", PasswordDot:="",
Revert:=0, WritePasswordDoc:="", WritePasswordDot:="",
Connection:="DSN=GAVURAH;UID=sa;PWD=;APP=Microsoft
Query;WSID=SHIVAINDRA;LANGUAGE=us_english;DATABASE=lp_patents",
SQLStatement:="execute splp_lppci_US " & Chr(34) & OrderLetterNumber &
Chr(34), SQLStatement1:=""
WordBasic.MailMerge CheckErrors:=1, Destination:=0, MergeRecords:=0,
From:="", to:="", Suppression:=0, MailMerge:=1, MailSubject:="",
MailAsAttachment:=0, MailAddress:=""

This works fine on our Word97 machines, but on the Word2002 machines the
macro breaks down and asks for the to connect to a data base.

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

Similar Threads


Top