LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
VDU VDU is offline
external usenet poster
 
Posts: 16
Default Macro for sending e-mail with info from an excel sheet

Hello,

I'm not sure if this is even possible but if it is, it would be great.

I'm trying to make a macro that sends an e-mail based on information present
in an excel sheet but does not send the excel file as attachment (like the
"sendmail" method)

The perfect solution would be something like the "Send to mail recipient"
option but I cannot seem to get that from VBA (tried recording to see what
happens in VBA when I use that option, doesn't record anything).

The problem in short is this:

I have to create a macro that opens a new mail message window filled with:
- the contents of cell L22 (1 to 10 names separated by ";") in the "To" field
- the contents of cell L23 (1 to 10 names separated by ";") in the "CC" field
- the contents of cell B24 in the "Subject" field
- the contents of cells A29 to L51 in the "Body" field keeping the format of
the tables and colored cells)
- if the macro can resolve the names in to and cc (equivalent to Ctrl+K) it
would be great but this is not crucial.

In long:

I have a sheet containing a form where information can be entered, the sheet
processes this information to a different format which I need to send via
e-mail. this can be done perfectly by "send mail to recipient" but I need to
have the To, CC and Subject fields filled automatically with info from the
same sheet as well which cannot be done with the above option.

The sheet contains:
- Data area, where raw data is added and calculated
- Mail info area containing a cell with names used to determine addresses
for the "To" field separated by ";" , a cell for the "cc" field same as for
"To" and 1 cell containing the subject (determined by a formula using data
from the data area)
- mail body area containing the text & tables to be added to the mail body.
Values are determined using formulas for either calculation or reference to
cells in the data area.

There are 2 incomplete solutions for this problem, which could complement
together great if I would find a way to make them work together.

The first one would be the "send mail to recipient" option which uses the
body (given mail body area has it's own sheet) but does not automatically
fill the TO, CC and Subject fields of the mail

The second one is a post called "Send email based on cell value" which can
fill the To and CC and subject fields using data from the sheet and I managed
to adapt Ron de Bruin's solution a bit but I got stuck at keeping the
formatting for the body.

Please help, thank you.
Valentin
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending active sheet by mail without macro (from Ron's page) Dan Excel Programming 5 November 8th 07 05:40 PM
Error sending sheet in mail body Corey Excel Programming 2 August 23rd 07 01:51 AM
Sending one sheet by mail Robert Excel Discussion (Misc queries) 1 June 18th 06 10:43 AM
sending one sheet by e-mail gareth Excel Programming 3 November 7th 03 01:01 PM


All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"