Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Outlook macro to display purlic folder from a toolbar button

Posted on 2009-04-09
6
Medium Priority
?
465 Views
Last Modified: 2012-05-06
I would like to create a macro to open a public calendar from a toolbar button. The calendar is located at:

\\Public Folders\All Public Folders\Penn_Machine_Company\_Public Calendar

I thought about making a shortcut but the shortcuts in Outlook 2007 can't be moved to the toolbar.

Thanks
0
Comment
Question by:alank2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 24109556
Hi, alank2.

This should do it.
Sub OpenPublicFolder()
    Dim olkFolder As Outlook.Folder
    Set olkFolder = Outlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Penn_Machine_Company").Folders("_Public Calendar")
    olkFolder.Display
    Set olkFolder = Nothing
End Sub

Open in new window

0
 

Author Comment

by:alank2
ID: 24109705
BlueDevilFan,

I figured you would get this. I forgot to add the full path to the calendar, so I changed the line to:

Set olkFolder = Outlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Penn_Machine_Company").Folders("_Public Calendar").Folders("Calendar")

It works fine, however a second Outlook appears with the calendar. Is it possible to click run the macro so that the Outlook just switches to the calendar?

Thanks

0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 24109758
You're welcome.  This version opens the folder in the existing Outlook window.
Sub OpenPublicFolder()
    Dim olkFolder As Outlook.Folder
    Set olkFolder = Outlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Penn_Machine_Company").Folders("_Public Calendar").Folders("Calendar")
    Set Outlook.Application.ActiveExplorer.CurrentFolder = olkFolder
    Set olkFolder = Nothing
End Sub

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:alank2
ID: 24109810
Works great,
Thanks again.
0
 

Author Closing Comment

by:alank2
ID: 31568630
Always the best
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24109880
Thanks.  Always happy to be of assistance.  Cheers!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question