Object variable not set

Why do I get The error message Object variable not set in this code?

code

Sub Click(Source As Button)

Dim ws As NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = ws.CurrentDocument

Dim komit As String



komit = uidoc.FieldGetText("organizacija")  



If komit =" " Then

	Messagebox "the field is empty!!",,"warning"

	Exit Sub

End If

End Sub

I need a Lotusscript code that will collect the value of a field

that has name and surname in it and then make a username that would be first letter of name and the surname, if such an user name exists that he should take two letters from the name and so on! If i have two users with the same name and surname than a number should be atached until 100! And i should generate a password!

I cant do it alone! Help!

Do you have any code outhere??

Thanks

Subject: Object variable not set

You have to set

first line like this one

dim ws as new NotesUIWorkspace

this will work

DEVs’’