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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Outlook Email

Status
Not open for further replies.

simoncpage

Programmer
Apr 4, 2002
256
GB
Hi all

Can anyone help me I would like to be able to open a new email message from Excel and be able to have control over the sent to and subject of the email? Is this possible and if so how?

Any help would be most appreciated
Thanks,
Simon
 
Hi Simon,

yes it's possible. As to how - that depends mainly on which email client you're using. Try searching this forum - there's been quite a few questions & answers lately on emailing from excel using Outlook, Lotus Notes & Groupwise. And there's usually any amount of code to go with the answers ;-)

Good luck

Cheers
Nikki
 

Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "name@domain.com"
.Subject = "Automated Mail Response"
.Body = "This is an automated message from Excel. " & _
"The cost of the item that you inquired about is: " & _
Format(Range("A1").Value, "$ #,###.#0") & "."
.Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub

using this with an outlook reference and but I have used the copypicture function to copy a range to the clipboard and I want to paste this in the new message as either and attachment or ideally in html?
 
There is an attachments collection in the mailitem object (objMail in your code above). Will that help you?

Have a great day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top