Re: merging with query in access 2003 by jbc
jbc
Fri Feb 09 13:37:01 CST 2007
Doug,
This is the code I'm using. I recorded it in Word. I'm getting a dialog
box that asks me to confirm data source. When I choose MS Access Databases
with DDE it works.
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\jbc\My Documents\Member\Membership.mdb" _
, ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"QUERY qryRenewalForm1", SQLStatement:= _
"SELECT * FROM [qryRenewalForm1]", SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
Thanks.
jbc
"Doug Robbins - Word MVP" wrote:
> It might help if you posted the code that you were using and indicated what
> line of code was highlighted when the error occurs.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "jbc" <jbc@discussions.microsoft.com> wrote in message
> news:50899D0F-9665-4FE0-AA2D-5C47C09C641B@microsoft.com...
> >I also want to note that the code should open access if necessary and run
> >the
> > merge.
> >
> > thanks.
> >
> > "jbc" wrote:
> >
> >> Hi,
> >>
> >> I would like to automate merging between word and access 2003. I had
> >> code
> >> that worked in 2000, but now I'm getting error messages.
> >>
> >> Thanks.
> >>
> >> jbc
>
>
>