I have a script to remove files from a certain rich text field in my form in case anyone tries to put them in there. The problem is that although it removes the files from that particular field, they now show up at the bottom of the form all grouped together (not as part of the original field).
Here is the code I am using:
v=10
Forall o In rtitem3.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then
If v = 10 Then 'just want to answer question once.
v = Messagebox("Please put attachments into the Attachments field" & Chr(13) & "OK to remove attachments?", 36, "Remove attachments?")
End If
If v = 6 Then 'OK to remove attachments
Call o.remove 'This is where I remove the file
Call doc.Save(False,False) Else
Call doc.removeitem("tmpArchive")
Exit Sub
End If
End If
End Forall