Domino 9 und frühere Versionen > Entwicklung

object variable not set

(1/1)

my head:
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...

Semeaphoros:
if not (uidoc is nothing) then .....

Glombi:
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

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln