General discussion

Locked

Retrieving the current Mailbox within a

By drfox ·
I have an Outlook Item Template, that on opening ask you to select a valid mailbox from the current Global Address List.

What I want is for it not to ask me but to find the current mailbox that is open, i.e for myself the mailbox name would be Fox, David how can I retrieve this value within a VB script.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Retrieving the current Mailbox within a

by msheehan In reply to Retrieving the current Ma ...

Sub Command_Click()
Set oOutlook = CreateObject("Outlook.Application")
Set oNS = oOutlook.GetNameSpace("MAPI")


From there you can (for example) :

Set oCalendar = oNS.GetDefaultFolder(olFolderCalendar)
Set oItems = oCalendar.Items
Set oFirst = oItems.GetFirst()
oFirst.Display

The key is getnamespace("MAPI") which just uses the current login.

-Mike

Collapse -

Retrieving the current Mailbox within a

by drfox In reply to Retrieving the current Ma ...
Back to Web Development Forum
2 total posts (Page 1 of 1)  

Software Forums