Xenix
Registered User.
- Local time
- Today, 21:26
- Joined
- Oct 8, 2001
- Messages
- 124
I am having problems with my code to send emails, the code works fine but I want to be able to edit the email before it sends but I cannot see how to do it
here is a copy of my code:
'DoCmd.Save acForm, "Quotation"
DoCmd.OpenReport "QuotationEmail", acNormal, "", "
'DoCmd.Save acForm, "Quotation"
DoCmd.OpenReport "QuotationEmail", acNormal, "", "
=[Forms]![Quotation]!"
MsgBox "Please press OK after previewing the quotation in the PDF viewer to send E-Mail", vbOKOnly, "Email Quotation"
'------------------------------------------------------------
' Send Email
' Takes the to message from the form and sends it via outlook
' Also attaches the files listed below
'------------------------------------------------------------
Dim appOutl As Object
Dim MyNameSpace As Object
Dim myemail As Object
On Error GoTo Email_Err
Set appOutl = CreateObject("Outlook.Application")
Set MyNameSpace = appOutl.getNameSpace("MAPI")
Set myemail = appOutl.CreateItem(0)
myemail.To = [Forms]![Quotation]![Email2]
myemail.bcc = [Forms]![Customer]![LocalSalesEmail]
myemail.subject = "Honda Connectors Quotation"
myemail.body = ""
myemail.Attachments.Add "c:\program files\adobe\acrobat 4.0\PDF Output\Custom~1.pdf", , , "Custom~1.pdf"
If Forms!Customer!Terms = False Then
myemail.Attachments.Add "c:\program files\adobe\acrobat 4.0\PDF Output\Terms.pdf", , , "Terms.pdf"
Forms!Customer!Terms = True
End If
myemail.Send
Kind regards and thank you in advance
Mike