Using Auto Signature with Appointment Custom Outlook Form


G

Guest

Hello,

My client wants the signature of the current user to show up in the
appointment body of my custom form. I found code that will work if you want
it to appear in a IPM.Note message, as shown below, but this code does not
work for an appointment. In using the code below I get errors for using the
Item.HTMLBody command and if I change it to be Item.Body, I get no errors,
but no signature appears in the appointment body, and yes the signature does
appear in the message body, already checked that.

Does anyone know if you can add a signature to the body of an appointment
custom form, and if so the code required to do it?

Thanks,

nYssa

CODE:
Function Item_Open()
Const olMailItem = 0
Const olDiscard = 1
If Item_Size = 0 Then
Set objSigMail = Application.CreateItem(olMailItem)
' next line triggers security prompt in OL2002 Sp3
Item.HTMLBody = objSigMail.HTMLBody
objSigMail.Close olDiscard
End If
Set objSigMail = Nothing
End Function
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

You'd have to use Body, not HTMLBody, which is not a supported property for
appointments. You might need to display objSigMail before retrieving the
value of objSigMail.Body.
 
G

Guest

Hi Sue,
if I change it to be Item.Body, I get no errors,but no signature appears in the >appointment body, and yes the signature does appear in the message body
As previously mentioned I have tried this, and have also displayed the
objSigMail object before retrieving the HTMLBody or Body, have tried both.
Any other suggestions?
 
S

Sue Mosher [MVP-Outlook]

I'd use the script debugger put in a breakpoint (or just put Stop in the
code) and check the value of objSigMail.Body to try to get a clearer picture
of what's going on.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Ad

Advertisements

G

Guest

Finally got it to work. Here is the code I used to put the signature for the
current user into the message body of an appointment. By the way, it doesn't
deal well with hyperlinks.

Sub StartNewCustomMsgWithSig(strMessageClass)

Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
Set objSigMail = objOL.CreateItem(olMailItem)
objSigMail.Display
Item.Body = objSigMail.HTMLBody
Item.Body = objSigMail.Body
objSigMail.Close olDiscard

Set objOL = Nothing
Set objNS = Nothing
Set objSigMail = Nothing
End Sub
 

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