Need Help with this Code; E-Mail

D

Dave Elliott

How can i make this prompt me for a To (Send To ) Customer?

On Error GoTo Error_Handler



Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = "(e-mail address removed)"
.Subject = "Invoice from Gulf Coast Electric"
.body = "Thanks for your Business"
.Attachments.Add "C:\PDFReports\Test.pdf"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox err & ": " & err.Description
Resume Exit_Here
 
F

fredg

How can i make this prompt me for a To (Send To ) Customer?

On Error GoTo Error_Handler

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = "(e-mail address removed)"
.Subject = "Invoice from Gulf Coast Electric"
.body = "Thanks for your Business"
.Attachments.Add "C:\PDFReports\Test.pdf"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox err & ": " & err.Description
Resume Exit_Here

..To = InputBox("To whom?")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top