Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim controldocview As NotesView
Set controldocView = db.GetView("AC")
Dim controldoc As NotesDocument
Set controlDoc = controldocView.GetDocumentByKey( "Timeframe" , True)
If controlDoc Is Nothing Then
Dim uidoc As notesuidocument
Set uidoc = workspace.ComposeDocument( "", "", "TF" )
Else
Msgbox "A Timeframe doc already exists." & Chr(10) & Chr(10) & "Please update this doc instead.", 0 + 64 , "Invalid Function"
End If