我從來沒有用過interop.domino.dll,但我認爲這些方法可以幫助你:
如果你可以使用evaluate
功能,您可以使用@NameLookup
公式:
evaluate("@NameLookup([Exhaustive];Chair;'InternetAddress')",CalendarDocument)
另一種方法是「手動」查看Domino目錄中的名稱:
- 通過
session.addressbooks
,找到一個公共的和服務器上的名稱。
- 獲取視圖
$VIMPeople
。
getDocumentByKey
使用縮寫名稱格式。
編輯
這裏是(未經測試)LotusScript代碼來獲取網際地址給定用戶,應該是比較容易翻譯成C#:
Function GetInternetAddress(username as string) as string
On Error Goto errorthrower
dim session as new NotesSession
dim dominodirectory as NotesDatabase
dim notesusername as new NotesName(username)
forall candidate in session.AddressBooks
if candidate.isPublicAddressBook and candidate.Server <> "" then
set dominodirectory = candidate
exit forall
end if
end forall
if dominodirectory is nothing then error 1900,"Failed to find Domino Directory."
if not dominodirectory.isOpen then call dominodirectory.open("","")
dim view as NotesView
set view = dominodirectory.getView("$VIMPeople")
dim document as notesdocument
set document = view.getDocumentByKey(notesusername.Abbreviated, true)
if document is nothing then error 1900,"Failed to find document matching '" & username & "'"
GetInternetAddress = document.InternetAddress(0)
Exit Function
ErrorThrower:
Error Err, Error & Chr(13) + "Module: " & Cstr(Getthreadinfo(1)) & ", Line: " & Cstr(Erl)
End Function
可以或許請詳細說明「使用縮寫名稱格式的getDocumentByKey」? – Ryk 2011-05-18 05:34:26
用一些檢驗代碼更新了我的答案。 – 2011-05-18 07:44:22
謝謝,真的有幫助 – Ryk 2011-05-19 00:22:20