UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Signature Add, Office 2010    
 
   
arun.ms0910
post Jun 19 2019, 06:34 AM
Post#1



Posts: 19
Joined: 19-June 19



Hi Frnds,
How to add signature in outlook using excel vba.HelpMe.. iconfused.gif
Go to the top of the page
 
ADezii
post Jun 19 2019, 07:39 AM
Post#2



Posts: 2,641
Joined: 4-February 07
From: USA, Florida, Delray Beach


  1. Outlook Signatures need to have been previously created and they exist in a specific location on your Hard Drive. They also exist in three different Formats, namely: *.txt, *.rtf, and *.htm.
  2. The following Code will:
    1. Create an Instance of Outlook using Early Binding.
    2. Create a simple Mail Item with basic Arguments supplied.
    3. Open a specific Signature File (Work_Signature.htm) in the Default Path.
    4. Specify some Text in the Body (HTMLBody) of the E-Mail, then append the Signature.
    5. Display the E-Mail for review.

    CODE
    Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Dim strSignature As String
    Dim strBody As String

    Set appOutLook = New Outlook.Application
    Set MailOutLook = appOutLook.CreateItem(olMailItem)

    strBody = "Here is information regarding our new Vice President of Operations"

    Open (Environ("appdata") & "\Microsoft\Signatures\Work_Signature.htm") For Input As #1
    strSignature = Input(LOF(1), #1)

    With MailOutLook
      .To = "JohnDoe@Mail.com"
      .Subject = "Some Subject"
      .HTMLBody = strBody & "<br><br>" & strSignature & "<br>"
         .Display
    End With

    Close #1
  3. Hope this helps.
Go to the top of the page
 
DanielPineault
post Jun 19 2019, 07:56 AM
Post#3


UtterAccess VIP
Posts: 6,854
Joined: 30-June 11



See http://www.devhut.net/2010/09/03/vba-send-...ook-automation/ for a function that works for me and retains the default signature.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
arun.ms0910
post Jun 19 2019, 08:03 AM
Post#4



Posts: 19
Joined: 19-June 19



Thank you for ur reply soon..i'll check and confirm thanks.gif
Go to the top of the page
 
arun.ms0910
post Jun 21 2019, 04:46 AM
Post#5



Posts: 19
Joined: 19-June 19



Thank you ADezii.its working.. thanks.gif
Go to the top of the page
 
ADezii
post Jun 21 2019, 05:37 AM
Post#6



Posts: 2,641
Joined: 4-February 07
From: USA, Florida, Delray Beach


yw.gif
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    21st September 2019 - 12:53 PM