Can someone please help in forcing users to only allow .tif attacments in a richtext field. I am using the code below in a text editable field below the body field. The problem is these are old files that are needed to be included in docs. There is a new procedure in place to attach links to another rtf field using a scheduled agent. So, there are 2 rtf fields in the document. So, no matter if the body field has .tif or not the error msg still appears
@If(@Right(@AttachmentNames; “.”) = “TIF”; @Success;@Failure(" ONLY TIF FILE TYPES ARE ALLOWED AS ATTACHMENTS."))
Subject: RE: Only allow .tif format in a rich text field
So only TIF files are allowed for new attachments. So what you need is a list of the old attachments. You can get this with a computed for display field (multivalued) with a formula such as: @If(@IsDocBeingLoaded; @AttachmentNames; @thisvalue). Now your input translation formula can use that field: _tmp := @Uppercase(@Rightback(@trim(@Replace(@Attachmentnames; oldattachments; “”)); “.”));@If(_tmp != “” & _tmp != “TIF”; “complain”; @Success)
Alternately, you can look in the actual rich text field using LotusScript code in the Querysave event. Use NotesUIDocument.Refresh(True) (use On Error to trap any errors that occur doing this and exit without printing an error of your own). Now you get the Source.Document and GetFirstItem(“yourRichTextField”), and you can scan that for embeddedobjects and decide whether to display an error and abort the save by setting Continue=False.
Subject: RE: Only allow .tif format in a rich text field
Thank you very much!