"Type Mismatch" Problem

Dear all,

I have written the script below in the QueryModeChange and it always pop out “Type Mismatch” error when I try to edit a document. Can anyone please help to check what’s wrong with the script. Thank you.

Dim ws As New NotesUIWorkspace

Dim ss As New NotesSession

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim accessrole As Boolean

Set db = ss.CurrentDatabase

Set uidoc = ws.CurrentDocument

Const role = “@IsNotMember(@Name([Abbreviate]; @UserName); Createby : Participant)”

accessrole = Evaluate(role)

If accessrole = True Then

    Messagebox "You are not authorised to edit this document !"

    Continue = False

    Exit Sub

Else

    Continue = True

End If

Subject: RE: “Type Mismatch” Problem

Declare role as string data type and try.

Subject: “Type Mismatch” Problem

Evaluate always returns a variant, so you have to access the role as “If accessrole(0) then” or you can try imploding accessrole and read it as a string

  • Sudhir