Felder per Script ausfüllen

  • Hallo,


    ich würde gerne das Feld datumtest mit dem aktuellen Datum füllen, folgenden Code habe ich eingetragen:


    Sub Click(Source As Button)

    Dim workspace As New NotesUIWorkspace
    Dim Datumtest As NotesUIDocument
    'Messagebox Today
    Set datumtest = workspace.CurrentDocument

    Call Datumtest.FieldSetText("Zeitfenster", Today )

    End Sub


    Fehlermeldung: Incorrect argument type: string expected!


    Woran liegt das?


    mfg

  • Today ist ein Datumswert und du versuchst einen Text hineinzuschreiben.
    Also Today noch in einen Text umwandeln, entweder per CStr(Umwandeln ohne Einflussmöglichkeit) oder per Format (Umwandeln mit Einflußmöglichkeit)

  • Today liefert ein Variant zurück


    Cstr(Today) soltle hinhauen. Wenn nicht, dann Format$(Today), "Format")


    Wobei "Format" folgendes sein kann:

    Code
    [b]General Date[/b]	In a standard format. Converts a floating-point number to a date/time. If the number includes no fractional part, this displays only a date. If the number includes no integer part, this displays only a time.
    [b]Long Date[/b]	A Long Date as defined in the operating system's international settings.
    [b]Medium Date[/b]	dd-mmm-yy (yy/mmm/dd in Japan)
    [b]Short Date[/b]	A Short Date as defined in the operating system's international settings.
    [b]Long Time[/b]	A Long Time as defined in the operating system's international settings. Long Time always includes hours, minutes, and seconds.
    [b]Medium Time[/b]	Hours (0 - 12) and minutes using the time separator and AM/PM notation (AMPM notation in Japan)
    [b]Short Time[/b]	Hours (0 - 23) and minutes using only the time separator.


    greetz
    RW

    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