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 = "[email protected]"
.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 = "[email protected]"
.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?")
 
Top