insert signature with VBA

  • Thread starter Thread starter VilMarci
  • Start date Start date
V

VilMarci

Hi all,

Is there any way to insert a signature with VBA automatically into the
message body?

What I'd like to have is a button in my Access form that opens up a new OL
mailitem, insert a few info from the form and the user's signature from
his/her OL.

I know how to open the mail item etc, which object is the signature. When
lookin in the help, signature only showed the suffs for digital signature
that I don't want.

Is there any way?
Please help,
Thanks,

Marton
 
I know how to open the mail item etc, which object is the signature.

The end of the message body? :-)
 
There is no object representing the signature. I've posted some Outlook 2002/3 code that shows a couple of methods. For Outlook 2000, you'd need to use Redemption's SafeInspector.
 
Is there any way to insert a signature with VBA automatically into the
message body?
[snip]

I know only of the "hard way":

Sub AddSignature(strBody As String, strSigFile As String)
Dim fso As FileSystemObject
Dim ts As TextStream

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(strSigFile, ForReading)
strBody = strBody & ts.ReadAll
Set ts = Nothing
Set fso = Nothing
End Sub

Which could possibly be shortened to (untested):
strBody = strBody & CreateObject("Scripting.FileSystemObject").OpenTextFile(strSigFile, ForReading).ReadAll
 
Thanks all...

I'll try this one. Or maybe a small database containing the signatures for
the users logged in...
Sad not to have the signature object :(

Marton

Michael Bednarek said:
Is there any way to insert a signature with VBA automatically into the
message body?
[snip]

I know only of the "hard way":

Sub AddSignature(strBody As String, strSigFile As String)
Dim fso As FileSystemObject
Dim ts As TextStream

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(strSigFile, ForReading)
strBody = strBody & ts.ReadAll
Set ts = Nothing
Set fso = Nothing
End Sub

Which could possibly be shortened to (untested):
strBody = strBody & CreateObject("Scripting.FileSystemObject").OpenTextFile(strSigFile,
ForReading).ReadAll
 
Back
Top