I have a view and in the “View Action” button I am trying this code… When I select a document in the view and press the action button, it should detach all the attachment files from the Body field from the selected document.
I get an error “Object variable not set” ?? CAn somebody tell me why?? (This is the code from the designer Help)
CODE:
Dim doc As NotesDocument
Dim rtitem As Variant
Dim fileCount As Integer
fileCount = 0
'…set value of doc…
Set rtitem = doc.GetFirstItem( “Body” )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
fileCount = fileCount + 1
Call o.ExtractFile( "c:" & Cstr(fileCount) )
Call o.Remove
Call doc.Save( False, True )
End If
End Forall
End If