C
Chip
Hey Everyone,
I'm not sure if this has been answered yet or not. Mr. Kallal's Super
Easy Mail Merge is working awesome for many of my applications. But I
was hoping someone could show me if there is an easy to augment this
code to send these mail merge documents, as attachments to an Outlook
email. I have some experience with Outlook coding in Access and I
have a rudementary application running. So I need to merge (sorry for
the pun) the two technologies; Mail Merge and Outlook.
Currently my Outlook code looks like this
On Error GoTo AddTask_Err
' Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
Dim outobj As Outlook.Application
Dim outmail As Outlook.MailItem
Set outobj = CreateObject("outlook.application")
Set outmail = outobj.CreateItem(olMailItem)
With outmail
.To = "(e-mail address removed)" ' This will be changed to a
predetermined field.
.Subject = "Certification Course Approval"
.BodyFormat = olFormatHTML
.Actions
.Save
.Send
End With
' Release the Outlook object variable.
Set outobj = Nothing
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Approval Sent!"
Exit Sub
AddTask_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
And of course the super easy mail merge application code is
MergeSingleWord. I'm supposing that what I need is save the document
in MailMerge termporarily, then email the document as an attachment in
the Outlook Code. I know there is a .Attachment arguement but dont
know how to set its parameters.
This is going way beyond my expertise and I'm hoping someone can take
pity on me here... Any and all sugestions are appreciated..
Chip Franklin
I'm not sure if this has been answered yet or not. Mr. Kallal's Super
Easy Mail Merge is working awesome for many of my applications. But I
was hoping someone could show me if there is an easy to augment this
code to send these mail merge documents, as attachments to an Outlook
email. I have some experience with Outlook coding in Access and I
have a rudementary application running. So I need to merge (sorry for
the pun) the two technologies; Mail Merge and Outlook.
Currently my Outlook code looks like this
On Error GoTo AddTask_Err
' Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
Dim outobj As Outlook.Application
Dim outmail As Outlook.MailItem
Set outobj = CreateObject("outlook.application")
Set outmail = outobj.CreateItem(olMailItem)
With outmail
.To = "(e-mail address removed)" ' This will be changed to a
predetermined field.
.Subject = "Certification Course Approval"
.BodyFormat = olFormatHTML
.Actions
.Save
.Send
End With
' Release the Outlook object variable.
Set outobj = Nothing
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Approval Sent!"
Exit Sub
AddTask_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
And of course the super easy mail merge application code is
MergeSingleWord. I'm supposing that what I need is save the document
in MailMerge termporarily, then email the document as an attachment in
the Outlook Code. I know there is a .Attachment arguement but dont
know how to set its parameters.
This is going way beyond my expertise and I'm hoping someone can take
pity on me here... Any and all sugestions are appreciated..
Chip Franklin