+ Reply to Thread
Results 1 to 3 of 3

Adding Default Signature to Macro Generated Email

  1. #1
    Registered User
    Join Date
    09-05-2018
    Location
    Clayton, MO
    MS-Off Ver
    Windows 10
    Posts
    1

    Post Adding Default Signature to Macro Generated Email

    Using this Excel table:
    1.PNG

    I'm trying to generate emails that look like this:
    2.PNG

    The emails I'm looking to create contain 1) .to 2) .cc 3) .subject 4) .body with personalized message (i.e. the body can't be HTML'd in) and 5) email signature. Below is the code that I'm using which successfully completes items 1-4 but not item 5.

    Option Explicit
    Sub Send_Multiple_Email()
    Dim sh As Worksheet
    Set sh = ThisWorkbook.Sheets("Sheet2")
    Dim OA As Object
    Dim msg As Object
    Set OA = CreateObject("Outlook.application")
    Dim i As Integer
    Dim last_row As Integer
    last_row = Application.WorksheetFunction.CountA(sh.Range("A:A"))
    For i = 2 To last_row
    Set msg = OA.CreateItem(0)
    msg.To = sh.Range("A" & i).Value
    msg.CC = sh.Range("B" & i).Value
    msg.Subject = sh.Range("C" & i).Value
    msg.body = sh.Range("D" & i).Value & msg.body
    msg.display
    Next i
    End Sub

    I am hoping someone can help with a command or code restructuring that keeps the auto generated Outlook email signature. The line "msg.body = sh.Range("D" & i).Value & msg.body" wipes out the signature and I've tried several solutions with no success

    Thanks so much in advance for any help!

    Michael

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Adding Default Signature to Macro Generated Email

    Hi Michael

    Welcome to the Forum.
    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing.
    So, do the following:
    Edit your post, highlight your code and click the [#] button at the top of the post window.
    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Adding Default Signature to Macro Generated Email

    oops, missed the mod request. Will follow up after you comply.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Trying to add a default signature into an email from VBA
    By murp5972 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-13-2015, 09:33 AM
  2. [SOLVED] default email signature
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2015, 10:55 AM
  3. [SOLVED] Excel VBA code for saving PDF to file & adding default signature to Email
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2014, 01:54 AM
  4. Embed a picture as a signature in an Outlook email generated by VBA in Excel
    By zach.sauls in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2013, 11:10 AM
  5. Email macro, include variable in body & add default outlook signature
    By promithius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 09:05 AM
  6. send selected range in email with default outlook email signature included
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 10:50 PM
  7. Unable to link default email signature to email
    By paxile2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2010, 06:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1