Get Mailbox name in Outlook Addin using VSTO
I'm working on开发者_开发问答 Outlook 2003 AddIn using VSTO.Is there a way to Get the Mailbox Name OR NTUserName of the user.
To Get the user name logged on via outlook use Application.NameSpace.CurrentUser
To get the Mailbox Name in 2007 use Store.DisplayName Property
(Edit) In Outlook 2003 you can get the parent of the Inbox folder and the name property should be what you want.
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder= myNameSpace.GetDefaultFolder(olFolderInbox)
Set myParentFolder = myFolder.Parent
Marcus
精彩评论