Setting profile document

Using below code I am trying to update profile document to obtain next sequential number. I am getting error after Editmode =True line. Incorrect Argument type: string accepted. I put Cstr and still getting Vairant does not contain a container.Please advise

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession   

Dim uidoc As NotesUIDocument

Dim db As notesdatabase

Dim doc As NotesDocument

Dim SeqNo As Variant

Dim NxtSeqNo As Variant

Dim view As NotesView



Set uidoc = workspace.CurrentDocument

Set db = session.currentdatabase

Set view = db.getview("GetNum")

Set doc = view.GetFirstDocument

key = doc.CodeAlpha(0)

Set doc = view.GetDocumentByKey( key , False)



If Not (doc Is Nothing)Then

	SeqNo = doc.GetItemValue("Seq")

	NxtSeqNo = SeqNo(0) + 1

	uidoc.editmode = True

	Call uidoc.FieldSetText( "Seq", Cstr(NxtSeqNo(0)))

	success = doc.computewithform(False, False)

	Call doc.save(True,True)

End If

Subject: NxtSeqNo(0)

Hey,

does NxtSeqNo(0) contain data?

Subject: Create profile document

Thanks I got that working. Now I need to add a code to create profile document if doesn’t exist. Please advise