Object variable not set

  • So Hallo wieder mal.


    Sub Entering(Source As Field)
    Dim session As New NotesSession
    Dim persgroup As String
    Dim doc As NotesDocument

    Set doc = session.DocumentContext
    If Instr( "hallo", hallo") >0 Then
    Call doc.GotoField( "field1" )
    End If

    End Sub




    Problem dass er bei dem Ausführen von "gotToField"die Fehlermeldung "Object variable not set" wirft.


    was mach ich da falsch?


    PS: das Dokument ist im Editiermodus, wenn ich das ausführe.
    Danke

  • Dann lies dir mal die Hilfe zu "DocumentContext" durch, dann weißt du auch, was du falsch gemacht hast...


    Mit NotesUIWorkspace.CurrentDocument.Document würdest du auch das dazugehörende Backend-Dokument bekommen.


    /edit:
    Halt ma, Kommando zurück! "GotoField" ist vom NotesUIDocument. "doc" ist aber ein NotesDocument. Das kann so nicht gehen.

    Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming "Wow, what a ride!!! :evil:
    Beschleunigung ist, wenn die Tränen der Ergriffenheit waagrecht zum Ohr hin abfliessen - Walter Röhrl