Archive for March, 2017

Hallow … ngetik lagi .. to the point sesuai judul diatas

Sub Click(Source As Button)
  Dim ws As New NotesUIWorkspace
  Dim uiDoc As NotesUIDocument
  Dim doc As NotesDocument
  Dim rtItem As Variant
  Dim embObjs As Variant
  Dim TotalSizeAttached As Long

  Set uiDoc = ws.CurrentDocument
  Set doc = uiDoc.Document

  uiDoc.Refresh (True)
  oneMB = 1048576
  Set rtItem = doc.GetFirstItem("Body")
  If Not Isempty(rtItem) Then
    embObj = rtItem.EmbeddedObjects
    For i = 0 To Ubound(embObj)
       TotalSizeAttached = TotalSizeAttached + embObj(i).FileSize
       If (embObj(i).FileSize > oneMB) Then
         Messagebox "Your Filename: " + embObj(i).Name + Chr(13) + "Size: " +_
         Cstr(Round(embObj(i).FileSize / oneMB,1)) + " MB" + Chr(13) +_ 
         "is too big, maximum only 1 MB", MB_OK, "Check each attachment file"
       End If
    If (TotalSizeAttached > 4 * oneMB) Then
       Messagebox "Your attachment file more than 4 MB maximum allowed", MB_OK,_
       "Maximum attachment reached"
       continue = False
    End If
  End If
End Sub

Dah gitu ajah … yang jelas ditulis disini biar gak lupa.

Script diatas disimpan dimana, silahkan simpan dimana saja sebagai validation size menggunakan RichTextEdit field type.



Read Full Post »