LOTUSSCRIPT/COM/OLE CLASSES


Examples: GetValueCustomDataBytes method
This agent gets custom data in the current document. The custom data is in an item named TenBytesItem and was given a type name of TenBytesType when it was written.

Sub Initialize
 Dim session As New NotesSession
 Dim doc As NotesDocument
 Dim item As NotesItem
 Dim customData As String
 Set db = session.CurrentDatabase
 Set doc = session.DocumentContext
 If doc.HasItem("TenBytesItem") Then
   Set item = doc.GetFirstItem("TenBytesItem")
   If item.Type = USERDATA Then
     bytes = item.GetValueCustomDataBytes("TenBytesType")
     Forall b In bytes
       customData = customData + Chr(b)
     End Forall
     Messagebox customData,, "Custom data"
   Else
     Messagebox "Not custom data",, "TenBytesItem"
   End If
 Else
   Messagebox "No item in document",, "No TenBytesItem"
 End If
End Sub

See Also