Hi there,I have a problem with a special agent in context to load Pictures from a webInterface into a document.
In Case of special requests, i stored the File into a “Temporary” Document, which is deleted after the whole process. This Document has some other fields, which are not interesting here, BUT to get the special $File field copy into another document i remove all items except those, named “$FILE”, and then uses copyallitems
My Problem is, that currently the Items are removed, but there are two $File fields in the document, so both of them are copied. How can I identifie a $File field and remove it. I tried to get the file name with items.values(0) but it doesn’t worked.
Subject: delete $File - code to determine attachement name
This does not do what you need, but should be enough to get you well on your way.
Function ValidateAttachement(CurrDocBackEnd As NotesDocument) As Boolean
Dim EmbedObjVar As Variant
Dim EmbedObj As NotesEmbeddedObject
Dim NRTItem As NotesRichTextItem
Dim ObjName As String
Dim ObjExt As String
Dim ObjLeft3 As String
'Check if any
If CurrDocBackEnd.HasEmbedded Then
Set NRTItem = CurrDocBackEnd.GetFirstItem("Detail")
EmbedObjVar = NRTItem.EmbeddedObjects
If Isempty(EmbedObjVar) Then
ValidateAttachement = True
Else
Forall Obj In EmbedObjVar
If ( Obj.Type = EMBED_ATTACHMENT ) Then
ObjName = Obj.Name
ObjExt = Ucase(Right(ObjName, 3))
If ObjExt = "DAT" Then
ObjLeft3 = Ucase(Left(ObjName, 3))
If ObjLeft3 = "ATT" Then
ValidateAttachement = False
Exit Function
Else
ValidateAttachement = True
End If
Else
ValidateAttachement = True
End If
End If
End Forall
End If
Else
ValidateAttachement = True
End If