Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for emailing a single sheet.

Status
Not open for further replies.

Twosips

Technical User
Feb 26, 2004
3
US
Can someone tell me the syntax in a Powerplay macro for emailing a single sheet of an excel file? My code is below.

Dim objOutlook As Object
Dim objOutlookEmail As Object
Dim objOutlookAttachments As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookEmail = objOutlook.CreateItem(OlMailItem)
objOutlookEmail.Subject = "email subject"
objOutlookEmail.Body = "body of email text"
objOutlookEmail.To = "username@isp.com"
Set objOutlookAttachments = objOutlookEmail.Attachments
objOutlookAttachments.Add "C:\Documents and Settings\username\Desktop\filename.xls"
objOutlookEmail.Display
objOutlookEmail.Send
Set objOutlook = Nothing
Set objOutlookEmail = Nothing
Set objOutlookAttachments = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top