Consulting

Results 1 to 3 of 3

Thread: Add Signature to Reply Email?

  1. #1
    VBAX Regular
    Joined
    Mar 2019
    Posts
    15
    Location

    Add Signature to Reply Email?

    I want to use my default signature in a reply email. I am using Signature as an example.

    Sub ReplyMSG12()
    Dim nameExample As String
    Dim olItem As Outlook.MailItem
    Dim olInsp As Outlook.Inspector
    Dim wdDoc As Object
    Dim oRng As Object
    Dim olReply As MailItem
    Dim Signature As String
    Signature = Environ("AppData") & "\Microsoft\Signatures" & "MainSig.htm"
    For Each olItem In Application.ActiveExplorer.Selection
    nameExample = Split(olItem.SenderName, Chr(32))(0)
    Set olReply = olItem.ReplyAll
    olReply.Display
    With olReply
    Set olInsp = .GetInspector
    Set wdDoc = olInsp.WordEditor
    Set oRng = wdDoc.Range(0, 0)
    oRng.Text = "Hi " & nameExample & vbCr & vbCr & _
    "We are in receipt of your RFQ" & vbCr & vbCr & _
    "Thanks," & vbCr & vbCr & _
    Signature
    End With
    DoEvents
    Next olItem
    Set olReply = Nothing
    Set olItem = Nothing
    Set olInsp = Nothing
    Set wdDoc = Nothing
    Set oRng = Nothing
    End Sub

  2. #2
    If you have a signature associated with that account, the code should leave that signature.
    If it doesn't, change the line
    Set oRng = wdDoc.Range(0, 0)
    to
    Set oRng = wdDoc.Range
    oRng.Collapse 1
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Regular
    Joined
    Mar 2019
    Posts
    15
    Location
    Hi Graham,

    Thank you for this! I just had to go to my Signature settings and have it displayed on reply emails.

Tags for this Thread

Posting Permissions

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