Link to home
Start Free TrialLog in
Avatar of BullmanTech
BullmanTechFlag for United States of America

asked on

How can I have Outlook 2007 open my Personal AND Internet Calendars as the default view (using VBA?)?

I want all 10 computers (running XP and Vista) that are using Outlook 2007 to open as a default view to Personal Calendars AND any Internet Calendars that are currently being subscribed to.  By navigating to Tools--Options--Other--Advanced Options, you can choose the Startup folder (i.e. my personal calendar, or an internet calendar subscribed folder), but it will open only that calendar and leave any other calendars "unopened", or unchecked, needing to be checked in order to be viewed.  The internet calendar subscriptions then need to be manually checked on the left-hand navigation pane in order to view them with the personal calendar (currently set up to view in overlay mode, weekly).

One important thing to note in terms of a possible workaround is this:
If I check my personal calendar and my internet calendar subscriptions on the left-hand navigation pane, and change the "Startup in this folder" setting (Tools--Options--Other--Advanced Options) to "Inbox", and then restart
outlook, it will open the Inbox first (obviously).  But then when I click on the Calendar button/link in the navigation pane, all calendars (personal AND internet subscriptions) are still selected as a remembered setting from the previous session. So if I could tell Outlook to default open to the Inbox using the above method, and then have some sort of script that would switch to the calendars in the same way that clicking "Calendar" in the navigation pane, then this would solve my problem.

I have some limited experience with VB application development, and VBA in Excel, so if there is a simple script that I can run to accomplish this, some sort of loop that will check all calendars, something like that, I could handle that much.  Please point me to any information that will solve my problem, thanks!!
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BullmanTech

ASKER

Thanks so much for the code, I think it worked and accomplished exactly what I need.  The only thing is that I don't know how to get a Startup event to work in Outlook.  I just pasted your code in and then played around with the following code (I named another procedure Application_Startup and put a few simple Outlook actions in there to test it):

Public WithEvents Application_Startup() As Outlook.Application

I put that in as a class level statement, but I get an error message that says "Compile Error: Only valid in object module."  I have no idea what I'm doing (obviously) as I've mostly done VB in VS 2005 and a tiny bit of VBA in Excel.  I'm assuming that you can guide me to a solution easy enough.  Thanks again.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much for the help, I'm 99% there.  The only thing left to do is figure out how to switch from the mail to the calendar!

Sean Bullman
BullmanTech
You're welcome.