anything in Excel...

It's Excel-o-lozy...

VB - Send E-Mail as inline text from Excel

Thought of sending E Mail from MS Excel working sheet as inline text rather than attachment...?
No matter it's a table or letter text, it's possible...
Moreover, Draft mail will be visible (better option rather than sending it directly, if any manual change is required)...
Hereunder goes the VB code... free for use...
Sub vEMail()
    'Make sure you select cells to be sent as inline text
    Selection.Copy
    Dim MailObj, MailLine As Variant
    On Error GoTo ErrorMsg
    Set MailObj = CreateObject("Outlook.Application")
    Set MailLine = MailObj.CreateItem(0)
    With MailLine
        .Subject = Range("B4") 'put Subject in Cell B4 or change reference here
        .To = Range("B5") 'put Receiver's ID in Cell B5 or change reference here
        .cc = Range("B6") 'put CC in Cell B6 or change reference here
        .bcc = Range("B7") 'put BCC in Cell B7 or change reference here        '.Body = "Press Ctrl+V to paste", best way to keep Default Signature in body


        .Display 'to view the automatically Drafted ready to be sent E-Mail
        '.send 'to directly send, remove single quote mark before .send and put single _
         quote in front of .display in above line, provided .body is linked
    End With


ErrorMsg:
    If Err.Description <> "" Then MsgBox Err.Description


End Sub

After you see the Drafted mail, you have to Press Ctrl+V to paste the text body. Its best option as it preserves default Signature of sender.

Click "Send" and Enjoy the power of automation...

Astalavista...

0 comments: