Wrong number of arguments

I have an app that worked great with the R5 client but is causing a bit of a problem with the R6 client.

There is a bit of script on the QueryOpen event that seems to be the problem. I got this code off of this forum and have not made any modifications to it as worked well; til the upgrade. Here it is:

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)

If (Source.IsNewDoc) Then

	Exit Sub

End If   'New Doc, Lock not reqd

Dim varLock As Variant

Dim session As New NotesSession

Dim nnUserName As New NotesName(session.UserName)

Set docBackend=Source.document

varLock=docBackend.GetItemValue("Lock")

If (varLock(0) <> "") Then

	Msgbox ("Document is currently locked by "+varLock(0)+". A read-only copy will be opened for your use.")

	Exit Sub

End If

docBackend.Lock=nnUserName.Common

Call docBackend.Save(True,True)

End Sub

When I use the debugger and step through the alert pops up between docBackend.Lock=nnUserName.Common

and

Call docBackend.Save(True,True)

I know just enough to be dangerous and have no idea how to stop this error from coming up. It all looks OK to me.

Any help you can offer is greatly appreciated.

Thanks

Subject: Wrong number of arguments

In R6, there is a new property on NotesDocument called Lock, so you have to rename that field, or use doc.getItemValue(“Lock”).

  • Johan

johan@kanngard.net

http://dev.kanngard.net