insert signature with VBA

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
 
B

Bernie

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

The end of the message body? :)
 
S

Sue Mosher [MVP-Outlook]

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.
 
M

Michael Bednarek

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
 
V

VilMarci

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top