Domino Code Fragment

Code Name*
Use FrontEnd Classes to pass Current Document to Backend classes!
Date*
05/14/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.137.170.14
Description*
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Handy way to capture the current document using Front End classes to pass current document to Back End class using "document property" of NotesUIDocument. This then allows you to use the methods and properties of NotesDocument on current document.
Files/Graphics attachments (if applicable): Code:
Sub Initialize
    Dim workspace As New NotesUIWorkspace
    Dim source As NotesUIDocument
    Set Source = Workspace.CurrentDocument
    Dim doc As NotesDocument
    Set doc = source.Document
    Dim refto As Variant
         
    refto = doc.GetItemValue("To")
    Dim v As Integer
    v = Ubound(refto)

     For i = 0 To v
         Messagebox refto(i)
    Next i
End Sub