Button to sign doument using Lotus script

I have a document that needs to be approved (signed off) by one of the editors before it can be called “official” and be used by others.

I want to have a button that signs the users name and dates the entry. Something like “TheUsername - 01/12/2007”. This info would be placed in a field called “spApproval”

The button needs to check that the user is a Notes “Editor”.

This is probably very simple but I am a newbie to Lotus Script and any help would be appreciated.

Subject: Button to sign doument using Lotus script

Hi Evan,This will do it if you just need to check if they have editor in the ACL:

Dim s As New NotesSession

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument	

Set uidoc=ws.CurrentDocument

If s.CurrentDatabase.CurrentAccessLevel = 4 Then

	Call uidoc.FieldSetText("spApproval", s.CommonUserName & " - " & Now)

End If 	

hope that helps…

Subject: RE: Button to sign doument using Lotus script

I tried the code and it did not work. I have “Manager” access which includes “Edit” access. I should have specified “Edit” access or above. So, would the code read:

If s.CurrentDatabase.CurrentAccessLevel > 3 Then…

Rather then,

If s.CurrentDatabase.CurrentAccessLevel = 4 Then…

Also, the use of “Now” carries the time. I assume I substitute “Today” for “Now” and get only the date.

Subject: RE: Button to sign doument using Lotus script

Yep, that is correct.