When I attach a file to a document on the web, then view that same document in the notes client the attachment appears in a sort of preview frame of the document, not in any particular rich text field or the like. But let’s say I want to attach a file in the notes client and have it appear in this same fashion with out having to goto (or create) a rich text field to attach to. The only way I can see is to append it to a rich text field but I don’t want to do that. Is there a way to do this in the notes client so that attachements added to the document are always shown in that “preview like” pane?
Subject: Attachments In Notes Client
Simply attach the file to a richtext item that is not displayed on the form, and the Notes Client will display the attachment at the bottom of the form.
Subject: RE: Attachments In Notes Client
That worked, here’s the code I used if anyone’s interestsed:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim rtitem As Variant
Set uidoc = ws.CurrentDocument
uidoc.EditMode = True
Set doc = uidoc.Document
Set rtitem = doc.GetFirstItem( "attachments" )
If ( rtitem.Type = RICHTEXT) Then
filenames = ws.OpenFileDialog( _
True, "Select files",, "c:\")
If Not(Isempty(filenames)) Then
Forall filename In filenames
'embed the filename to doc
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", filename)
End Forall
End If
Else
Set rtitem = New NotesRichTextItem( doc, "attachments" )
filenames = ws.OpenFileDialog( _
True, "Select files",, "c:\")
If Not(Isempty(filenames)) Then
Forall filename In filenames
'embed the filename to doc
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", filename)
End Forall
End If
End If
’ Call uidoc.Reload
Msgbox "File attached, please save the document to secure the attachment to the form."
End Sub