2013-11-01 34 views

回答

3
Function getUserMailServer() As NotesName 
    Dim session As New NotesSession 
    Dim maildb As New NotesDatabase("", "") 
    Call maildb.OpenMail 
    Dim nName As NotesName 
    Set nName = session.CreateName(maildb.Server) 
    Print("Server: " + nName.Abbreviated) 
    Set getUserMailServer = nName 
End Function 

maildb.OpenMail給你的郵件數據庫的當前用戶。

maildb.Server返回郵件數據庫的完整服務器名稱。

session.CreateName()從服務器名稱創建NotesName對象。 (如maildb.Server)。

+0

感謝您的回覆,如果我必須縮寫並將其作爲NotesName返回,那麼這將如何工作,林新蓮花腳本,所以如果我沒有意義,請糾正我 – Lappies

+0

我改變了我的答案。我把代碼放在一個函數中,它將用戶的電子郵件服務器作爲NotesName對象返回。這不僅僅是服務器名稱,而且是一個具有諸如'.Abbreviated'或'.Common'等類屬性的對象。調用函數後,您可以決定要對結果執行的操作:將其存儲在文檔的名稱字段中或以某種形式顯示。 –

+0

感謝隊友,完美工作 – Lappies

2

您還可以使用NotesDirectory類的GetMailInfo方法。這使您可以獲取您指定的每個用戶的郵件數據庫。

mailinfo = notesDirectory.GetMailInfo(username) 

mailinfo是含有一個字符串數組,用於指定用戶的信息以下一個變體:

Mail Server - Home mail server for the specified person. 
BuildNumber - If getver is true, a string representation of the build number of the specified person's mail server, for example, "303". If getver is false, "". 
DominoVersion - If getver is true, a string representation of the Domino version of the specified person's mail server, for example, "Build V80_07042006NP". If getver is false, "". 
MailFile - Mail file for the specified person. 
ShortName - Short form of the specified person's name. 
MailDomain - Notes Domain of the specified person's mail address. 
User Name - First entry in the list of user names honored for the specified person. 
InternetMailAddress - Internet mail address for the specified person. 
OutOfOffice - Out of Office service type. "1" indicates Agent, "2" indicates Service. 

見IBM幫助here獲得更多信息。

+0

請您添加IBM幫助的鏈接。讓你的答案更好。 – Shriroop

+0

編輯我的答案。感謝您的反饋:) –

+0

我已經再次編輯你的答案。看看編輯模式,這就是Url應該被添加的方式。希望這有助於你未來的職位。 – Shriroop

相關問題