Manage Learn to apply best practices and optimize your operations.

Informing the users of their mail size and quotas via the standard MailFS frameset

You Can View User Feedback To This Tip

Upgrading to R5 mail quotas have started to be used more and more. I wanted a way to tell how much space I had left in my mail file so that I would not receive that horrid, "...would exceed it on disk quota..." message. The solution I came up with was a small piece of LotusScript that checks the mail file size and displays a "status bar" graphic. It includes the size of file along with a percentage reading and current size. By placing this information in the top left frame of the mail file frameset, users can see when their database is getting too close to its maximum file size.

The solution involves three steps:
1. Create a new form with four fields
2. Add the LotusScript to the PostOpen event of the form
3. Modify the MailFS Frameset to include the form

Code: 1) First, create a form and create four "Computed For Display" fields as follows:

SaveOptions with a value of "0"
DisplayBar with value DisplayBar (make it native OS style with a size of 0.700")
MailDisplay with value MailDisplay
FileSize with value FileSize
Make all the fields of type text, font Default Sans Serif size 8 and plain (apart from DisplayBar which should be bold)

Place the SaveOptions field at the top of your form

Then add a fixed width 1x2 table (Column One fixed at 0.75", Column Two fixed at 1.25") and place the DisplayBar field in column One and MailDisplay and FileSize in column two but on separate lines.

Once you have added the fields, add the following script to the PostOpen event of your new form then save and close the form.

'Script begins
Sub Postopen(Source As Notesuidocument)
    Dim session As New notessession
    Dim db As notesdatabase
    Dim doc As notesdocument
    Set db = session.currentdatabase
    Set doc = source.document
    dbsize = (db.size)/1000
    dbmax = db.sizequota
    percent = (dbsize/dbmax)

    For i = 0 To (percent*100)
    bars = bars & "|"
    ' Each bar represents 5%
    i = i + 5

    message = "Database at " & Cint(percent*100) & "%"

    doc.FileSize = Format((dbsize/1000) , "Fixed") & "Mb"
    doc.MailDisplay = message
    doc.DisplayBar = bars
End Sub
'Script ends

Now all that remains is to update the frameset design so that the top left frame does not to include the "Mail Title" page but your new form.


  • I liked the example of the Frameset notice of the quota but it has a minor bug -- the FOR LOOP includes "i = i + 5" but does not take into consideration that the FOR also increments the counter. Thus, the counter is being incrementing by six rather than five. I also adapted it to my own preferences with a few twists.

         Dim session As New notessession
         Dim db As notesdatabase
         Set db = session.currentdatabase
         Const MB_OK = 0                 ' OK button only
         Const MB_IconInformation = 64   ' Information message
         dbsize = (db.size)/1000
         dbmax = db.sizequota
         percent% = Cint( dbsize/dbmax*100 )
         Bars$ = "  |"
         For i = 0 To 100
              If i <= Percent% Then
                   bars$ = bars$ & "="
                   bars$ = bars$ & " -"
              End If
              i = i + 4   ' Each bar represents 5%
         bars$ = bars$ & "|  "
         Print "Mail database at " & Percent% & "% of quota" & Bars$ & _
         "Size: " & Format((dbsize/1024) , "Fixed") & "Mb  Max: " & Format
    ((DBMax/1024) , "Fixed") & "Mb"
         If Percent% > 90 Then ' provide a stronger warning at 90%
              Msgbox "Mail database at " & Percent% & "% of quota" & Chr(10) &
    Chr(10) & _
              Bars$ & Chr(10) & Chr(10) & _
              "Size: " & Format((dbsize/1024) , "Fixed") & "Mb   Max: " &
    Format((DBMax/1024) , "Fixed") & "Mb", _
              MB_IconInformation + MB_OK, "Warning: Mailbox approaching maximum
         End If
    —Doug Jamieson

This was last published in April 2001

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.




  • iSeries tutorials'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 ...