Inserting a mail signature into document

Hello,I want to add a mail signature(from Calendar Profile) to a document in other database. I wite script:

Sub Postopen(Source As Notesuidocument)

            Dim session As New NotesSession

Dim db As New NotesDatabase( "", "" )

Dim cur_db As New NotesDatabase( "", "" )

Dim doc As NotesDocument

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim sig As Variant

Call db.OpenMail

Set cur_db=session.CurrentDatabase

Set doc=db.GetProfileDocument("Calendar Profile")

Set uidoc = workspace.CurrentDocument

sig=doc.GetItemValue("Signature")

Call uidoc.GotoField("Body")

Call uidoc.inserttext(sig)

End Sub

but this script is not working correct.It adding some information to a Body field but it is not “readable”. This information looks like encrypted.

Can you help me?

Aleksander Spila

P.S. To write this script i look to the CoreEmailClasses scipt library in my mail database

Subject: Inserting a mail signature into document

Is Signature a custom field you added to the Calendar Profile? If so I recommend changing it to some other name. Many documents have a reserved field called $Signature and this may be where your code is pulling the value from. Call your custom field something else and see if you still have a problem.

Subject: RE: Inserting a mail signature into document

No. I try to use original Signature field from a Calendar Profile profile document from a mail database.