Dim ws As New NotesUIWorkspace
Dim uidoc As notesUIDocument
Dim doc As NotesDocument
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document