How do I use lotusscript to stop attachments in a Lotus Notes RichText field. RichText item. RTitem in LotusScript. Disallow attachments or allow one attachment.
How do I use lotusscript to stop attachments in a Lotus Notes RichText field. RichText item. RTitem in LotusScript. Disallow attachments or allow one attachment.
| Answer | In the QuerySave Event of a form you can ue a similar function to this to stop attachments being inserted into the Rich Text field.
Set item = doc.GetFirstItem( "richtext" )
If Not Isempty( item.EmbeddedObjects) Then
n = 0
Forall att In item.EmbeddedObjects
If att.Type = EMBED_ATTACHMENT Then
n = n +1
End If
End Forall
If n > 0 Then
continue = False
Msgbox ( " No attachments in [ Rich Text ] field allowed"),16,"Not Saved"
Goto SkipApproval
End If
End If
To only allow one attachment, you can use the function below.
Set item = doc.GetFirstItem( "richtext" )
If Not Isempty( item.EmbeddedObjects) Then
n = 0
Forall att In item.EmbeddedObjects
If att.Type = EMBED_ATTACHMENT Then
n = n +1
End If
End Forall
If n > 1 Then
continue = False
Msgbox ( " No attachments in [ Rich Text ] field allowed"),16,"Not Saved"
Goto SkipApproval
End If
End If
|
| Attachments | -none- |
| Applies to versions | 5.x; 6.x |
| FAQ Provided By | Notes411 |
| Credit | |
 |  |
|
|