I'm working on Outlook 2003 AddIn using VSTO.Is there a way to Get the Mailbox Name OR NTUserName of the user.
+3
A:
Hi,
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
76mel
2010-02-10 10:51:12
*Store* is available only in Outlook 2007.. Is there a way to achieve the same in Outlook 2003
Deepak N
2010-02-10 12:19:49
Oops sorry forgot that you are using 2003, In 2003 Current user is there, the OOM does not expose it. You can get it playing with the parent of the Inbox. as above
76mel
2010-02-10 18:14:22
The above approach does not work if default mail delivery location is Personal Folder(.pst data file)..
Deepak N
2010-02-11 15:17:44
Are yes , I think you will have to go to MAPI using redemption then As I say the 2003 OOM does not expose it.
76mel
2010-02-11 20:12:23
+1 answer completed in the comments
Anonymous Type
2010-08-04 12:29:32