GetEmbeddedObject Problem

I’m working on a LotuScript program that will remove all UserID files from my NAB/Domino Directory and I seem to have run into a problem that while I’m doing exactly what the help files say I should use, I get an error. Here is the code:

Dim db As New NotesDatabase( “”, “c:\names.nsf” )

Dim view As NotesView

Dim doc As NotesDocument

Dim rtitem As Variant

Dim object As NotesEmbeddedObject

Set view = db.GetView( “People” )

Set doc = view.GetFirstDocument

While Not(doc Is Nothing)

Set rtitem = doc.GetFirstItem( “$File” )

If Not ( rtitem Is Nothing ) Then

Set object = rtitem.GetEmbeddedObject( "UserID" )

Call object.Remove

Call doc.Save( True, True )

End If

Set doc = view.GetNextDocument(doc)

Wend

When I run this, I receive an error when it encounters a Person doc with a $File and I try to set the object with the GetEmbeddedObject statement. The error I receive is “Instance member GETEMBEDDEDOBJECT does not exist”.

Would appreciate any help…

Mike Sanders

Surface Transportation Board

US DOT

Subject: GetEmbeddedObject Problem

Since these are V2-style attachments, you’d probably be better off going through the NotesDocument, checking with HasEmbedded and using GetAttachment to get a handle on the ID.

Subject: RE: GetEmbeddedObject Problem

Thanks, Stan. I’ll give that a shot.

Mike