add signature on email

Leo_Polla_Psemata

Registered User.
Local time
Yesterday, 23:19
Joined
Mar 24, 2014
Messages
364
Code:
            With M
            .BodyFormat = olFormatHTML
            .HTMLBody = Msg1
            
            .To = "me@gmail.com;"
            .CC = "you@gmail.com"
            .Subject = "xyzabc "
            .Display
            
        End With

Hi
With the above, we can tune our email parts, what should we type in order to have the signature laid at the end ?
I use outlook in which my signature is standard , however, when i open email from access, i have to add each time, manually, my signature.
 
before anything, copy this in a module:
Code:
Public Function ReadSignature(sigName As String) As String
' arnelgp
'
' sigName should include the .htm extension
'
Dim appDataDir  As String
Dim sig         As String
Dim sigPath     As String
Dim filename    As String
appDataDir = Environ$("APPDATA") & "\Microsoft\Signatures"
sigPath = appDataDir & "\" & sigName
With CreateObject("Scripting.FileSystemObject")
    sig = .OpenTextFile(sigPath).ReadAll
End With
' for testing only
'With CreateObject("Scripting.FileSystemObject").CreateTextFile(Environ("userprofile") & "\desktop\sig2.txt", True)
'    .Write sig
'    .Close
'End With
'
' fix relative references to images, etc. in sig
' by making them absolute paths, OL will find the image
filename = Replace$(sigName, ".htm", "_files/")
sig = Replace$(sig, filename, appDataDir & "\" & filename)
ReadSignature = sig
End Function
goto the folder where Outlook is saving the signature.
press (Win logo) + R (run)
type:
%appdata%\Microsoft\Signatures [Enter]
write (or memorize) the name of the file on that folder with .htm as extension.

your code:
Code:
    Dim sig As String
      '!!!!!
      ' Replace "MySig.htm" with the name of your signature
       sig = ReadSignature("Mysig.htm")

           With M
            .BodyFormat = olFormatHTML
            .HTMLBody = Msg1 &  "<p><br/><br/></p>" & sig
           
            .To = "me@gmail.com;"
            .CC = "you@gmail.com"
            .Subject = "xyzabc "
            .Display
           
        End With
 

Please read through the post above, same question was asked, and some ideas and codes were given.

Cheers
 

Users who are viewing this thread

Back
Top Bottom