例: FormUsers property

  1. 次の例は、[FormUser] フィールドに名前を追加します。
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim form As NotesForm
    Dim newFormUsers(0 To 63) As String
    Dim formUser As String
    Set db = session.CurrentDatabase
    Set form = db.GetForm(Inputbox("Name of form?"))
    If Isempty(form.FormUsers) Then
      n = 0
    Else
      For j = 0 To Ubound(form.FormUsers)
        newFormUsers(j) = form.FormUsers(j)
        Messagebox "Current form user: " & _
        newFormUsers(j)
      Next
      n = Ubound(form.FormUsers) + 1
    End If
    formUser = Inputbox("Name of form user?")
    Do While formUser <> ""
      newFormUsers(n) = formUser
      formUser = Inputbox("Name of form user?")
      n = n + 1
    Loop
    form.FormUsers = newFormUsers
  2. 次の例は [FormUsers] フィールドの内容を置換します。
    REM Replaces $FORMUSERS in total with what the user specifies here
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim form As NotesForm
    Dim newFormUsers(0 To 63) As String
    Dim formUser As String
    Dim emptyFormUsers As Variant
    Set db = session.CurrentDatabase
    Set form = db.GetForm(Inputbox("Name of form?"))
    n = 0
    formUser = Inputbox("Name of form user?")
    Do While formUser <> ""
      newFormUsers(n) = formUser
      formUser = Inputbox("Name of formUser?")
      n = n + 1
    Loop
    form.FormUsers = newFormUsers