例: ViewRefresh method

  1. 次のビューアクションは現在開かれているビューを更新します。
    Sub Click(Source As Button)
      Dim workspace As New NotesUIWorkspace
      Call workspace.ViewRefresh
    End Sub
  2. 次のビューアクションは現在のデータベースに文書を作成し、保存します。次に、現在のビューを更新して、新規作成した文書をビューに表示します。
    Sub Click(Source As Button)
      Dim workspace As New NotesUIWorkspace
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Set db = session.CurrentDatabase
      ' create the document and save to disk
      Set doc = New NotesDocument( db )
      doc.Subject = "This is my new doc"
      doc.From = session.UserName
      Call doc.Save( True, True )
      ' refresh current view to display the new document
      Call workspace.ViewRefresh
    End Sub
  3. 次のフォームアクションは、現在の文書を保存し、「Main」というビューを更新し、文書を閉じます。
    Sub Click(Source As Button)
      ' Declare all variables
      Dim workspace As New NotesUIWorkspace
      Dim session As New NotesSession
      Dim uidoc As NotesUIDocument
      Dim view As NotesView
      Dim db As NotesDatabase
      'Set all variables
      Set uidoc = workspace.CurrentDocument
      Set db = session.CurrentDatabase
      Set view = db.GetView( "Main" )
      'Save current document, refresh "Main" view 
      'and close document 
      Call uidoc.Save
      Call view.Refresh
      Call workspace.ViewRefresh
      Call uidoc.Close
    End Sub