Object Variable not set

Hi,

I’m am new to notes developement. I had the following message “Illegal circular USE:Standard” which I have not sort but now this message appears “Object Variale not set”. I am trying to setup an email alert that a user can type as message it a text box and this get emailed to a user.

The email and message work, however this message always appears “object variable not set” - which does annoy the users !!

Cheers

Stefan

Subject: Object Variable not set

It simply means that your code is referencing an object that has not been set, so it doesn’t understand what that object is. Here’s an example

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim uiDoc As NotesUIDocument

Set Doc=ws.CurrentDocument

The last line will give the same error you have becuase it is trying to reference an object called Doc and it doesn’t know what type of object it is, the last line should say (uiDoc not Doc)

Set uiDoc=ws.CurrentDocument

Subject: RE: Object Variable not set

Thanks for you post - that makes it clear… I now understand the message.

I will have a look and see what is not declared properly…

Many Thanks

Stefan

Subject: RE: Object Variable not set

Stefan,

You should turn on the LotusScript debugger while you search for the error. May not be needed in a short script, but useful for longer programs. It is Found under File… Tools… Debug Lotusscript. It is a system wide setting, which means that EVERY database you open while it is running will run LS in debug mode (this includes your mail file). I recommend adding the @command to an ICON in the toolbar via File… Preferences… Toolbar preferences and create an icon on the Universal Tool bar with this formuala: @Command( [DebugLotusScript] )

Clicking the icon will toggle the debugger on and off on your workstation and is usually more convenient than doing , T, D… the key sequence to do the same thing with the menu.