T
Todd K.
I am trying to set up a merge document with a constant recipient and a
constant subject, but different data in the body. I set up the document as a
Word merge (see code below) and it works fine, but it doesn't recognize the
field "email_address" as the "TO" address for the email. I tried using the
..MailAddressFieldName command, but then it wants to dig through my Outlook
contacts and I just want it sent to a constant email address. Is there any
way to do that?
Option Explicit
Private Sub Document_Open()
Me.MailMerge.OpenDataSource _
Name:="c:\My Database\GOLD_Master1.mdb", _
SQLStatement:="SELECT TblTEMP_PIO.Grant_Type, TblTEMP_PIO.Project_ID,
TblTEMP_PIO.Award_Date, TblTEMP_PIO.Fund_Amt, TblTEMP_PIO.County,
TblTEMP_PIO.email_address FROM TblTEMP_PIO;", _
subType:=wdMergeSubTypeOther
With Me.MailMerge
.MailSubject = "Press Release"
.Destination = wdSendToEmail
.Execute
End With
End Sub
constant subject, but different data in the body. I set up the document as a
Word merge (see code below) and it works fine, but it doesn't recognize the
field "email_address" as the "TO" address for the email. I tried using the
..MailAddressFieldName command, but then it wants to dig through my Outlook
contacts and I just want it sent to a constant email address. Is there any
way to do that?
Option Explicit
Private Sub Document_Open()
Me.MailMerge.OpenDataSource _
Name:="c:\My Database\GOLD_Master1.mdb", _
SQLStatement:="SELECT TblTEMP_PIO.Grant_Type, TblTEMP_PIO.Project_ID,
TblTEMP_PIO.Award_Date, TblTEMP_PIO.Fund_Amt, TblTEMP_PIO.County,
TblTEMP_PIO.email_address FROM TblTEMP_PIO;", _
subType:=wdMergeSubTypeOther
With Me.MailMerge
.MailSubject = "Press Release"
.Destination = wdSendToEmail
.Execute
End With
End Sub