VBScript - Return name of mailbox - Outlook 2003

  • Thread starter Thread starter Dwight Nelson
  • Start date Start date
D

Dwight Nelson

I would like to use VBScript to return the name of an
Exchange Mailbox with in an Appointment Item Form. I am
trying to assign the item.location field with the name of
the mailbox which is a member of the "other calendar"
section of outlook. The property I'm trying to return is
the caption of the sub-explorer right above where a
calendar is displayed. For example: if I have my
personal exchange calendar open and have another user's
calendar open side-by-side, there is a caption above each
calendar. My calendar's caption is just "calendar".
However the other user's calendar is listed as the
mailbox name or the other user's name. Does anybody know
how to return this caption?

By the way, I have used the following code in Outlook
2002 with success since the other users calendar opened
in a new window.

Item.location = Application.ActiveExplorer.Caption

However in 2003, the caption is of the overall outlook
window.

Thanks,
Dwight Nelson
 
Instead of using the caption, have you tried to extract the mailbox name
from the FolderPath property?
 
Thanks for the quick reply. I just tried the folderpath
property per your suggestion. If I'm on my own calendar
I get a path of "\\Mailbox - Dwight Nelson\Calendar".
However when I am working with another user's mailbox the
path is "\\\Calendar". Seems the mailbox info is missing.

Any other ideas?

Thanks again,
Dwight Nelson
 
So these are not folders from other mailboxes visible in the folder list?
I'd probaby try using the Organizer property for the items in the calendar
folder, although that could be misleading if the mailbox owner has a
delegate. It will also trigger security prompts.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
The Organizer property won't work for these events since
the calendar is not opened up the a MAPI profile
referencing the same calendar. The calendars do not have
enabled userids since they are being used as a resource
calendar only (room scheduling). These resource
calendars also "invite" master resource calendars which
need the location field filled in; that is why I want to
make this automatic with the mailbox name for the subject
calendar. Clear right? Sorry for all of the detail.

Thanks,
Dwight (by now we are on a first name basis)
 
Correction: the organizer name is not active until after
the item is sent so it cannot be used to fill in the
location field.

thanks,
Dwight
 
Back
Top