I'm working on Outlook 2003 AddIn using VSTO.Is there a way to Get the Mailbox Name OR NTUserName of the user.
Asked
Active
Viewed 4,604 times
1 Answers
4
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
- 3,993
- 2
- 22
- 21
-
*Store* is available only in Outlook 2007.. Is there a way to achieve the same in Outlook 2003 – Deepak N Feb 10 '10 at 12:19
-
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 Feb 10 '10 at 18:14
-
The above approach does not work if default mail delivery location is Personal Folder(.pst data file).. – Deepak N Feb 11 '10 at 15:17
-
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 Feb 11 '10 at 20:12