我从来没有用过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