Platform SDK: CDO for Windows 2000 |
The Delete method removes the specified BodyPart object from the collection.
[Visual Basic] Sub Delete(Item as Variant) [C++] HRESULT Delete( VARIANT Item); [IDL] HRESULT Delete([in] VARIANT Item );
You can delete the object by specifying its position in the collection or by passing the IBodyPart interface to the Delete method.
' Reference to Microsoft ActiveX Data Objects 2.5 Library ' Reference to Microsoft CDO for Windows 2000 Library Dim iMsg as New CDO.Message Dim iBp as IBodyPart Dim iBps as IBodyParts Set iBps = iMsg.BodyPart.BodyParts Set iBp = iBps.Add ... ' add more body parts iBps.Delete iBp ' delete this specific object iBps.Delete 2 ' delete object # 2