MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Using VB to send an Email. Need help with options...


Posted by Chris on February 15, 2001 2:39 PM

I know that when you use the "Send To" option in Excel, you can opt to send the spread sheet as the body of text in an email, or you can send it as an attachment.

I was wanting to know if you have the same options when trying to use VB to set up a macro for this. So far the only code I have come across lets me send it as an attachement and I would rather do the other way.

The current code I am using:

ActiveWorkbook.SendMail Recipients:="mailto"


Any help would be greatly appreciated.

Thanks
Chris


Posted by Matt P on February 16, 2001 6:34 AM

Posted by Matt P on February 16, 2001 6:58 AM

Try this:

Application.Dialogs(xlDialogSendMail).Show _

I have a macro that sends a report to any number of individuals, with customized filenames and individual passwords. Let me know if you want me to send you the file.

Posted by Chris on February 16, 2001 10:58 AM

Matt,

I tried what you suggested, but it still wants to send the worksheet as a attachement. What I am needing it to do is send what's typed on the worksheet and type it into the body of the email.

This is not unlike using the "Send to" then selecting the option "Mail Recipient". When I do it this way, I can opt to not send it as a attachment. Seems to me that if I can do this manualy, I should be able to do this with code.

If you want to email me the macro you are currently using, I would be than happy to take a look at it. Willing to try just about anything at this point.

Chris