例: GetMailInfo method

  1. 次の例では、サーバー「server name」のディレクトリで「Joe Smith」のホームサーバー情報を検索し、その情報を表示します。
Sub Initialize
        
    Dim session As New NotesSession
    Dim db As NotesDatabase
    
    Dim mynotesdir As NotesDirectory
    
    Set mynotesdir  = session.getDirectory("server name")
    
    Dim homeserver As Variant
        
    homeserver =  mynotesdir.GetMailInfo("Joe Smith", True)
    
    Msgbox "Mail Server: " + Cstr(homeserver(0))
    Msgbox "Build Number: " + Cstr(homeserver(1))
    Msgbox "Domino Version: " + Cstr(homeserver(2))
    Msgbox "Mailfile: " + Cstr(homeserver(3))
    Msgbox "Short Name: " + Cstr(homeserver(4))
    Msgbox "MailDomain: " + Cstr(homeserver(5))
    Msgbox "Username: " + Cstr(homeserver(6))
    Msgbox "internetMailAddress: " + Cstr(homeserver(7))
    Msgbox "Out of Office: " + Cstr(homeserver(8))
    
End Sub

  1. 次の例は、最初のメール情報の取得に失敗した場合、getver フラグを使用してユーザーのメールファイルサーバーに関する部分的な情報を取得します。
Function RetrieveMailInfo() As Integer
   On Error Goto ErrHandle
   RetrieveMailInfo = False

   Me.m_vOwnerMailInfo = Me.m_dirDirectory.GetMailInfo(Me.m_dbOwner, True)

   If Isempty(Me.m_vOwnerMailInfo) Then
      Me.m_vOwnerMailInfo = Me.m_dirDirectory.GetMailInfo(Me.m_dbOwner, False)
   End If
End Function

  1. このボタンは、ユーザーのメール情報を取得します。
    Dim session As NotesSession
    Dim directory As NotesDirectory
    Sub Initialize
    	Set session = New NotesSession
    	Set directory = session.GetDirectory("")
    End Sub
    
    Sub Click(Source As Button)
    	Dim mailinfo As Variant
    	Dim ooo As String
    	Dim mailmsg As String
    	Dim mailname As String
    	mailname = Inputbox$("Name of user")
    	On Error Goto mailerror
    	mailinfo = directory.GetMailInfo(mailname, True, False)
    	On Error Goto 0
    	If mailinfo(8) = "1" Then
    		ooo = "Agent"
    	Else
    		ooo = "Service"
    	End If
    	mailmsg = "Mail server:" & mailinfo(0) & |
    Build number: | & mailinfo(1) & |
    Domino version: | & mailinfo(2) & |
    Mail file: | & mailinfo(3) & |
    Short name: | & mailinfo(4) & |
    Mail domain: | & mailinfo(5) & |
    User name | & mailinfo(6) & |
    Internet mail address: | & mailinfo(7) & |
    Out of office service type: | & ooo
    	Messagebox mailmsg,, "Mail information for " & mailname
    	Exit Sub
    mailerror:
    	Messagebox  Error(),, "Error number " & Err()
    	Exit Sub
    End Sub