+ Reply to Thread
Results 1 to 8 of 8

Outlook Signature not Appearing on Mail VBA

  1. #1
    Registered User
    Join Date
    05-20-2022
    Location
    Mauritius
    MS-Off Ver
    10
    Posts
    9

    Outlook Signature not Appearing on Mail VBA

    Hello,

    I am currently working on a VBA macro which will be picking up email addresses from my excel list and automatically sending out the emails. Unfortunately, it is not including my outlook signature. Can someone please help me understand what is wrong with my VBA below?:

    Sub send_mass_email()
    Dim i As Integer
    Dim email, body, subject, copy As String
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String, SigString As String, Signature As String

    body = ActiveSheet.TextBoxes("TextBox 1").Text

    i = 2
    'Loop down name column starting at row 2 column 2
    Do While Cells(i, 2).Value <> ""

    email = Cells(i, 2).Value
    copy = Cells(i, 3).Value
    subject = Cells(i, 4).Value

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    With OutMail
    .to = email
    .cc = copy
    .subject = subject
    .body = body
    .send

    End With

    'reset body text
    body = ActiveSheet.TextBoxes("TextBox 1").Text & Signature

    'Change only Mysig.htm to the name of your signature
    SigString = Environ("appdata") & "\Microsoft\Signatures\Name.htm"
    If Dir(SigString) <> "" Then
    Signature = GetBoiler(SigString)
    End If

    i = i + 1
    Loop

    Set OutMail = Nothing
    Set OutApp = Nothing
    MsgBox "Email(s) Sent!"

    End Sub

    Function GetBoiler(ByVal sFile As String) As String
    Dim fso As Object
    Dim ts As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
    GetBoiler = ts.readall
    ts.Close
    End Function

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Outlook Signature not Appearing on Mail VBA

    At the beginning of creating an email, show it right away (Display).

    Artik

  3. #3
    Registered User
    Join Date
    05-20-2022
    Location
    Mauritius
    MS-Off Ver
    10
    Posts
    9

    Re: Outlook Signature not Appearing on Mail VBA

    Hello,

    Please explain where I should be including the (Display).

    Thanking you in advance

  4. #4
    Registered User
    Join Date
    05-20-2022
    Location
    Mauritius
    MS-Off Ver
    10
    Posts
    9

    Re: Outlook Signature not Appearing on Mail VBA

    Hi Can someone please let me know, i am still having issues with my outlook signature.

    thanking you for your help

    I am attaching the document as well. Thank you
    Attached Files Attached Files
    Last edited by Deepa0102; 08-04-2022 at 08:25 AM. Reason: Attaching my document

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Outlook Signature not Appearing on Mail VBA

    Try it
    Please Login or Register  to view this content.
    + GetBoiler function.

    Artik

  6. #6
    Registered User
    Join Date
    05-20-2022
    Location
    Mauritius
    MS-Off Ver
    10
    Posts
    9

    Re: Outlook Signature not Appearing on Mail VBA

    Dear Arvik,

    Thank you for your help. The signature is now appearing but unfortunately the images which are part of my signature are not appearing. Please see attached the issue I am getting. Do I need to add something to the VBA?
    Attachment 790371
    Thank you again!

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Outlook Signature not Appearing on Mail VBA

    So let's return to my first proposal. The GetBoiler function, in this example, will not be needed:
    Please Login or Register  to view this content.
    But there is one condition. In Outlook settings, attaching a signature to a new email is enabled. The screen will blink, but signatures should be included.

    Artik

  8. #8
    Registered User
    Join Date
    05-20-2022
    Location
    Mauritius
    MS-Off Ver
    10
    Posts
    9

    Re: Outlook Signature not Appearing on Mail VBA

    Hi Artik,

    Thank you! It works a treat

    Thank you again for your help!

+ 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. [SOLVED] Signature not appearing in post
    By Pepe Le Mokko in forum The Water Cooler
    Replies: 7
    Last Post: 02-12-2022, 04:42 AM
  2. [SOLVED] VBA adding default outlook signature to an outlook html message
    By jlive24 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2018, 11:59 AM
  3. Replies: 1
    Last Post: 12-20-2014, 03:36 AM
  4. [SOLVED] Add Default Signature When Sending a Range as HTML in Outlook e-Mail
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2014, 12:40 PM
  5. Replies: 0
    Last Post: 04-04-2013, 07:18 AM
  6. Mail Signature Script Error
    By tigerdel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2012, 09:19 PM
  7. Can't send E-mail signature
    By ncaravela in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-14-2010, 07:37 AM

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