Problem solve Get help with specific problems with your technologies, process and projects.

Capture size of attachments

I would like to capture the size of attachments. The size that I am looking for is the compressed size while the attachment is stored in the users mail file. Can you show an example of how to do this using LotusScript? Thanks.
The following script will check the current uidocument for attachments in the body and display the size of each.
Sub Initialize
  Dim workspace As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Dim doc As NotesDocument
  Set uidoc = workspace.CurrentDocument
  Set doc = uidoc.document
  If doc.HasEmbedded Then
    Set rtitem = doc.GetFirstItem( "Body" )
    If ( rtitem.Type = RICHTEXT ) Then
      Forall o In rtitem.EmbeddedObjects
        If ( o.Type = EMBED_ATTACHMENT ) Then
          Messagebox( o.FileSize )      
        End If
      End Forall
    End If
  End If  
End Sub

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...