|
-
Aug 29th, 2003, 07:38 AM
#1
Thread Starter
Member
Sending a single worksheet as an outlook body [RESOLVED]
I would like to be able to send a single sheet (not whole workbook) as the body (not attachment) of an Outlook mail. This is the best I can do but it only attaches the sheet to the mail:
Code:
Worksheets("Redemptions").Select
ActiveSheet.Copy
Application.Dialogs(xlDialogSendMail).Show "[email protected]", "My Subject"
I would be grateful for any ideas
Last edited by jrpfinch; Aug 29th, 2003 at 08:46 AM.
-
Aug 29th, 2003, 08:29 AM
#2
Frenzied Member
Trying to get Outlook to do something other than simple text in its .BODY property is not easy.
You will typically do better to create an HTML file, and use the .HTMLBody property in Outlook.
VB Code:
set out=WScript.CreateObject("Outlook.Application")
set mapi=out.GetNameSpace("MAPI")
set email=out.CreateItem(0)
email.Subject = "Test"
email.Body = "Test of HTML"
email.Send
Set outlook=Nothing
Set mapi=Nothing
Instead of using the .Body property above, try using the .HTMLbody property (which I hope exists from the VBScript / VBA environment).
olMail.HTMLBody = "<htmlbody><font color=#0000FF><p><b>New Invoice Numbers:</b></font><BR>" & myvar & "</htmlbody>"
-
Aug 29th, 2003, 08:46 AM
#3
Thread Starter
Member
Thanks
Thanks
I sussed it
BTW This site is very good for demonstrating how to send excel sheets as the body of an outlook mail
http://www.dicks-clicks.com/excel/olSending.htm
It's not a porn site don't worry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|