Removing one specific attachment

Hi,

In my document there are more than one document.I want to remove one specific attachment. Iam getting the name by object.name, but can not we remove that particular attachment whose name I’m having as object.name ?

Thanx

Subject: removing one specific attachment

Have you seen the example in designer help:

This script removes the “City picture” embedded object from the Body item in a document.

Dim doc As NotesDocument

Dim rtitem As Variant

Dim object As NotesEmbeddedObject

'…set value of doc…

Set rtitem = doc.GetFirstItem( “Body” )

If ( rtitem.Type = RICHTEXT ) Then

Set object = rtitem.GetEmbeddedObject( “City picture” )

Call object.Remove

Call doc.Save( True, True )

End If

If you can’t remove the specific attachment, then what is happening, what errors are you getting, how is your code being run etc.

Rufus.