View Single Post
  #3   Report Post  
Ed B
 
Posts: n/a
Default

I am trying to send data from an Access 2002 table to a standard merge
document in Word 2002. This process worked fine in Office 2000, but now I
can not get past the Word mail merge wizard with my macro. Does anyone know
how to send the necessary code to Word 2002 to bypass the wizard and merge
the data? The macro currently uses the SendKeys statement, but I would like
to use a more reliable method of calling up the merge.

The SendKeys statement is as follows:
SendKeys = +%TLM~G:\Regulatory\Form Letters\Standard.doc~%(trmm)

The Standard document is a letter with the merge fields already defined and
linked to the database.

The result of this is nothing happens. I dont get anywhere.

I recorded the following Macro in Word 2002
Sub MergeStandardLetter2()
'
'
ChangeFileOpenDirectory "G:\Regulatory\Form Letters\"
Documents.Open FileName:="Standard.doc", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
End Sub

But I have two problems,
a) Every time I run the Macro, I get the following screen box that I have to
respond to, that I would like to eliminate:

Opening this document will run the following SQL Command
SELECT*FROM [Payments & Filing - Current Session] WHERE (([LegalEntity] IS
NOT NULL))
Data from your database will be placed in the document. Do you want to
continue
YES NO
{would not allow me to paste the actual box on this post}

b) I dont know how to call up this Macro in Word from Access 2002.

I hope this gives you enough information to be able to help me.
--
Have a good day, Ed


"Cindy M -WordMVP-" wrote:

Hi ?B?RWQgQg==?=,

I am trying to send data from an Access 2002 table to a standard merge
document in Word 2002. This process worked fine in Office 2000, but now I
can not get past the Word mail merge wizard with my macro. Does anyone know
how to send the necessary code to Word 2002 to bypass the wizard and merge
the data? The macro currently uses the SendKeys statement, but I would like
to use a more reliable method of calling up the merge.

You really don't provide us with enough information. Which message? What are
your SendKey statements currently supposed to do (execute which steps)? Have
you tried recording these steps in a macro in Word in order to get the basic
syntax? If not, please do so and copy the code into your response.

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 :-)