Getting attachment before saving

Hi,

Can I get the name or size or number of attachments before I have saved the document?

Any suggestion will do!!!

Thanx

Subject: Getting attachment before saving

Got something may be this will help others as well -->This function is used to validate the RTF for attachments/Embedded objects/Any text before the document is being saved.

Code

Sub Querysave(Source As Notesuidocument, Continue As Variant)

On Error Goto Err_Handler	



Call Source.GoToField("RTF")

Call Source.SelectAll

Call Source.Copy

'When the RTF field is empty and Copy command is executed on the field, Notes generates an error

Call Source.DeselectAll

Exit Sub

Err_Handler:

If Err=4407 Then

	Msgbox "RTF field is empty", 48, "Validation Error"

	Continue=False

	Resume GoToExit

End If

GoToExit:

End Sub

Subject: Getting attachment before saving

Try this on a query save:

Dim ws As New notesuiworkspace

Dim uidoc As notesuidocument

Dim doc As NotesDocument

Dim rtf As Variant



Set uidoc = ws.CurrentDocument

uidoc.refresh True    

Set doc = uidoc.Document    ' I think you have to set the doc AFTER the refresh

Set rtf = doc.GetFirstItem("Body")



' now we can see what is there

Messagebox {The field contains the following text: "} & rtf.text & {"}	

If Not Isempty( rtf.embeddedobjects ) Then

	Msgbox "There are attachments or OLE objects here" 

End If