FieldSetText - Object variable not set

Good morning,

I’m a notes admin who is learning lotusscript.

I made a litte script, and at the end I always get the message ‘Object variable not set’.

My code :

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim output_name As String, input_name As String

input_name = Inputbox("Please fill in your name : ")

output_name = "Welcome " +  input_name

Messagebox (output_name)	

Call uidoc.FieldSetText("name_f",input_name)

End Sub

Everything goes well until the last line.

Has anyone an idea what I do wrong?

Thanks in advance

Greetings

Lainkes

Subject: uidoc is not completely ready.

Dim uidoc as Notesuidocument is there, but Set uidoc = Workspace.currentdocument is missing.

Subject: LotusScript help

After you dimension the variable uidoc as a NotesUIDocument, you need to store a value in it since you can’t use it until you do. To do this, insert the line :

Set uidoc = workspace.CurrentDocument

before you use the object in the FieldSetText method.

Hope that helps!