+ Reply to Thread
Results 1 to 3 of 3

Add Default Signature When Sending a Range as HTML in Outlook e-Mail

Hybrid View

EnigmaMatter Add Default Signature When... 09-27-2014, 11:29 AM
pareshj Re: Add Default Signature... 09-27-2014, 11:59 AM
EnigmaMatter Re: Add Default Signature... 09-27-2014, 12:40 PM
  1. #1
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Add Default Signature When Sending a Range as HTML in Outlook e-Mail

    Hello Everyone,

    The below CODE is my (adapted from the works of Ron De Bruin) Sub that sends a Range to an HTML e-Mail for distribution to Customers. How do I ammend the below code to also include the default signature in Outlook? As it stands, signatures have to be manually added to each distributed e-Mail.

    Any help would be really appreciated, and thank you.


    Sub MailRangeInOutlookBody()
    
    'Use with RangetoHTML Sub.
        Dim rng As Range
        Dim OutApp As Object
        Dim OutMail As Object
    
        Set rng = Nothing
        On Error Resume Next
        'Only send the visible cells in the selection.
        If Range("A4").Value <> 0 Then
            Range("A3:D3").Select
            Range(Selection, Selection.End(xlDown)).Select
        Else: Range("A3:D3").Select
        End If
        Set rng = Selection.SpecialCells(xlCellTypeVisible)
        On Error GoTo 0
    
        If rng Is Nothing Then
            MsgBox "The selection is not valid. " & _
                   vbNewLine & "You're an intelligent person. Try Again.", vbOKOnly
            Exit Sub
        End If
    
        With Application
            .EnableEvents = False
        End With
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        On Error Resume Next
        With OutMail
            .To = Range("H2")
            .CC = ""
            .BCC = ""
            .Subject = "FakeCompany Available Inventory for " & Range("A1").Value
            .HTMLBody = "<p><o:p>" & Range("H1").Value & "," & "</o:p></P>" & "Please let me know if FakeCompany can provide any of the following items for you today." & RangetoHTML(rng)
            .Display
        End With
        On Error GoTo 0
    
        With Application
            .EnableEvents = True
        End With
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Add Default Signature When Sending a Range as HTML in Outlook e-Mail

    Hi,

    Check the below link from Ron De Bruin for adding signatures to mail. Hope this will help you:

    http://www.rondebruin.nl/win/s1/outlook/signature.htm


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Re: Add Default Signature When Sending a Range as HTML in Outlook e-Mail

    Yes, I found that and it did not work until I read it again and realized I had forgotten the .Display line had to be moved.

    Thank You!

+ 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. HTML to Range -> OutApp: Outlook | Signature Issue
    By clprdctn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2014, 12:14 PM
  2. Excel ws into outlook html body with current html signature
    By Cadelanne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 09:03 AM
  3. Replies: 7
    Last Post: 08-11-2012, 02:39 PM
  4. Sending email with outlook signature
    By sexcel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-04-2008, 10:12 PM
  5. Replies: 1
    Last Post: 03-04-2005, 02:06 PM

Tags for this Thread

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