PDA

View Full Version : Choose A Salutation Based On Time Using VBA



Prabhu
10-24-2013, 10:16 PM
Hi,

I would like to customize my macro-sent emails a bit. Instead of the generic "Hello" greeting, I'd like to have:
Good morning,
Good afternoon,
and even Good evening,

based on the time of day that I execute the macro.

Also i want to incert my defalt signature in the mail.

Plz help to get VBA code.

Regards,

Prabhu

alansidman
10-25-2013, 12:59 AM
Suggest you post your VBA so that it can be determined how and where to place the necessary code. I am thinking that it will take a Case Select based upon the system time.

Excel Fox
10-25-2013, 10:20 AM
For inserting signature, please look at http://www.excelfox.com/forum/f18/send-outlook-mail-with-signature-range-from-excel-and-multiple-email-ids-304/

Prabhu
10-26-2013, 11:09 AM
Hi Alan,

Prabhu
10-26-2013, 11:18 AM
Hi ALan,

Plz find the workbook for your reference to insert salutation based on time (mail sent)

Also I would like to point out two more issue am facing with this macro.
I am using this macro to send the sheets(not workbook) as attachment to the specified mail id the VBA code.

if the mentioned sheet not available in the workbook then macro gets stopped. Kindly help amend the VBA code as if the specified sheet is not available then it should move to the next command.

Also I want to change the font, size and colour in the body of the email.(I preferred to send courier new with font size 11)

Kindly do the needful.
Prabhu