Sub Click(Source As Button) 'Title for dialog box Dim dialogTitle As String dialogTitle = "Insert Memo Clip" 'Message for dialog box Dim dialogMessage As String dialogMessage = "Choose the document you would like to insert in to your memo at the current cursor position." 'Location of the Team Mailbox Dim mailboxFilePath As String mailboxFilePath = "teammail\sales.nsf" Dim mailboxServer As String mailboxServer = "MyServer/LOTUS" Dim session As New NotesSession Dim workspace As New NotesUIWorkspace Dim db As NotesDatabase Set db = session.CurrentDatabase Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument Dim continue As Boolean continue = True 'The cursor must be in a rich text field. Dim currentFieldName As String currentFieldName = uidoc.CurrentField If (currentFieldName <> "Body") Then continue = False End If '(add other checks here) 'Continue? If( continue = False ) Then Print "The cursor must be in a rich text field." Exit Sub End If 'Display a dialog box. The user will select a MemoClip document. Dim dc As NotesDocumentCollection Set dc = workspace.PickListCollection( _ PICKLIST_CUSTOM, _ False, _ mailboxServer, _ mailboxFilePath, _ "($MemoClips)", _ dialogTitle, _ dialogMessage ) 'Did the user click Cancel? If( dc.Count = 0 ) Then Exit Sub End If 'Get the first document in the collection. Dim memoClip As NotesDocument Set memoClip = dc.GetFirstDocument 'Open the document in Read Mode. Dim memoClipUI As NotesUIDocument Set memoClipUI = workspace.EditDocument( False, memoClip, True, "", True, True ) If( memoClipUI Is Nothing ) Then Exit Sub 'The selected document should now be open. 'The MemoClip form uses the hide-when formula "copied to the clipboard" on everything except the Body field. 'Only the Body field will be copied to the clipboard. (This way we don't need to be in Edit Mode, and jump to a specific field before copying.) 'Select everything on the screen. Call memoClipUI.SelectAll 'Copy to the clipboard. Call memoClipUI.Copy 'Close the document. Call memoClipUI.Close 'Current document should now have focus. Paste from the clipboard. Call uidoc.Paste End Sub