+ Reply to Thread
Results 1 to 5 of 5

Inserting Signature.

  1. #1
    Registered User
    Join Date
    05-11-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    34

    Inserting Signature.

    Dear Friends,
    can anyone help me with a code line that automatically inserts my signature when i m sending the mail.
    Note: the mail is generated with the help of macro only so i would like to generate the signature with the help of code only.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Inserting Signature.

    hi,
    try this, it works!
    http://www.excelforum.com/excel-prog...-vba-code.html
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Inserting Signature.

    Hi yeshwant_sur

    Post your code...I'll look at it.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    05-11-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Inserting Signature.

    Function GetBoiler(ByVal sFile As String) As String
    '**** Kusleika
    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


    Sub test1()


    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String
    Dim SigString As String
    Dim Signature As String

    ' Set OutApp = CreateObject("Outlook.Application")
    ' Set OutMail = OutApp.CreateItem(0)



    SigString = Environ("appdata") & _
    "\Microsoft\Signatures\Mysig.htm"

    If Dir(SigString) <> "" Then
    Signature = GetBoiler(SigString)
    Else
    Signature = ""
    End If

    End Sub

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Inserting Signature.

    Hi yeshwant_sur

    Please include ALL of the Email Code AND wrap your code in Code Tags (See Rule #3).

    Also do a search on the word Signatures to find the correct Path of the Signatures Folder...let me know that Path and the Name of YOUR Signature File.
    Last edited by jaslake; 06-14-2012 at 10:19 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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