General discussion

  • Creator
    Topic
  • #2080829

    Retrieving the current Mailbox within a

    Locked

    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.

All Comments

  • Author
    Replies
    • #3895400

      Retrieving the current Mailbox within a

      by msheehan ·

      In reply to Retrieving the current Mailbox within a

      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

Viewing 0 reply threads