Why involve the user name at all? This is a more generic method, using the
Parent folder of the Inbox:
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
Set objTopFolder = objInbox.Parent
Set fd = objTopFolder.Folders("JEC - Calendar")
--
Sue Mosher
Author of
"Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours"
"Microsoft Outlook 2000 E-mail and Fax Guide"
Outlook and Exchange solutions at http://www.slipstick.com
Quote:
> Set fd = myNameSpace.Folders(myNameSpace.CurrentUser.Name & "'s
> Folders").Folders("JEC - Calendar")
> This line of Visual Basic code reconizes what user is in Outlook. It
works
> as long as the user's name does not end with "s".
> However if the user's name does end in "s" it doesn't work because the
> program doesn't reconize "s's".
> For example it would be Dennis' Folders instead of Dennis's Folders. How
do
> we get the program to reconize this?
> Should we use an if statement?