 |
|
 |
Subject: Add Signature using Lotus Scripts |
 |
 |
 |
Product Area: Domino Server |
 |
Technical Area: Application Development |
 |
Platform: Windows |
 |
Release: 8.5.3 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hi All,
Below is the code I written to add signature by clicking a button. I created a button in (calendar profile) form under signature form in Mail Template. I am into problem in two scenarios.
1. User already updated the Plain Text signature in Signature preferences. Then replaced the maifile design with which I customized. I click on button and details are properly updated in plain text field. But it still shows the old signature in the mail which user has update before design replacement.
2. Trying to click on the button with User ID. That is first scenario, I used admin ID to click on that button in user’s mailfile. Here I use User ID itself to click on button. Below is the error I get.
Error: Note error: You cannot update or delete the document(s) since you are listed as an allowable Author for this document
3. At the time of asking Inputbox$, the script goes to next line even if the user click on “Cancel” option. I do not want to continue script anymore if user clicks on “cancel”.
Please help to resolve the issue.
*******************************************************************************
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim doc1 As notesdocument
Dim EmpCode As Variant
Dim boxType As Variant
Dim Answer As Variant
Dim User, Company, Title,Signature As variant
Const MB_OK = 0
Const MB_ICONSTOP = 16
Const MB_OKCANCEL = 1
EmpCode = Inputbox$ ( "Enter your EmpCode", "EmpCode" )
If EmpCode = "" Then
boxType = MB_OK + MB_ICONSTOP
Answer = MsgBox ("Enter your EmpCode",boxType,"Update Signature")
End If
Set db = s.Getdatabase("Agaram/VMA", "names.nsf")
Set view = db.getview("Sig")
Set doc = view.Getdocumentbykey(EmpCode)
User = doc.Getitemvalue("FullName")(1)
Title = doc.Getitemvalue("JobTitle")(0)
Company = doc.Getitemvalue("CompanyName")(0)
Dim Plaintext,EnableSignature
Set doc1 = db.GetProfileDocument("CalendarProfile")
EnableSignature = doc1.Getitemvalue("EnableSignature")(0)
If EnableSignature=0 Then
Call doc1.Replaceitemvalue("EnableSignature", 1)
End If
Call doc1.Replaceitemvalue("SignatureOption", 1)
Signature = "Best Regards" + "," +Chr(10)& Chr(13)+ User + "," + Chr(10)&Chr(13) + Title + "," + chr(10)&Chr(13) + Company+"."
Call doc1.Replaceitemvalue("Signature_1", Signature)
Call doc1.save(True,False)
MsgBox "Completed"
 
Feedback number WEBB9GB9GU created by ~Howard Nimnukonygon on 02/14/2014

Status: Open
Comments:

Add Signature using Lotus Scripts (~Howard Nimnuko... 14.Feb.14)
. . Handle to mail file (~Sean Eljumigon... 14.Feb.14)
. . . . Thanks Barry!... (~Howard Nimnuko... 14.Feb.14)
. . . . . . One more Query (~Howard Nimnuko... 15.Feb.14)
. . . . . . . . Can't prevent that. (~Dan Kikiterobu... 15.Feb.14) |
|  |
|