Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: my head am 29.10.03 - 08:10:35

Titel: object variable not set
Beitrag von: my head am 29.10.03 - 08:10:35
hab folgenden code:

   Dim workspace As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Set uidoc = workspace.CurrentDocument
   Call uidoc.Refresh

wie kann ich abfragen, ob uidoc was beinhaltet?

z.b. if uidoc is not null then...
Titel: Re:object variable not set
Beitrag von: Semeaphoros am 29.10.03 - 08:24:00
if not (uidoc is nothing) then .....
Titel: Re:object variable not set
Beitrag von: Glombi am 29.10.03 - 08:25:21
Hi,
es kommt drauf an, von wo Du den Code aufrufst. Wenn Du das an irgendeiner Stelle in der Maske machst, ist uidoc immer gesetzt.

Die Anfrage, ob ein Objekt da ist, geht mit "is Nothing", z.B.
If uidoc Is Nothing Then
 Msgbox "Nothing"
End If


Das Refresh macht jedich nur im Editmode Sinn, daher bei solchen Dingen den Modus abfragen:

if uidoc.EditMode then
 call uidoc.Refresh
end if


Insgesamt also:
Dim workspace As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Set uidoc = workspace.CurrentDocument

if not (uidoc is nothing) then
 if uidoc.EditMode then
    Call uidoc.Refresh
 end if
end if

Andreas