show the correct calendar on start

Status
Not open for further replies.

Thorsten

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hello,

i've found Dianes makro for choosing the calendars in Outlook.
The pc should start with with Wakeonlan and Outlook in autostart and should show the correct calendar in Outlook (Conferenceroom Display). But when i select 'start Outlook with calendar view' it is showing the users calendar and not the one selected with case x. Only if i start the makro manually afterwards or if Outlook is started with emailview and then switched to calendars it is working (but not so automatic as i wish).
Is there a way for complete autostartstart with the (shared) calendar i wanted?

Regards
Thorsten
 
Sorry - i've forgot the code:

Code:
Dim WithEvents objPane As NavigationPane
   
Private Sub Application_Startup()
  Set objPane = Application.ActiveExplorer.NavigationPane
   
End Sub
   
   
Private Sub objPane_ModuleSwitch(ByVal CurrentModule As NavigationModule)
  Dim objPane As NavigationPane
  Dim objModule As CalendarModule
  Dim objGroup As NavigationGroup
  Dim objNavFolder As NavigationFolder
  Dim objCalendar As Folder
  Dim objFolder As Folder
   
  Dim i As Integer
   
  If CurrentModule.NavigationModuleType = olModuleCalendar Then
  Set Application.ActiveExplorer.CurrentFolder = Session.GetDefaultFolder(olFolderCalendar)
  DoEvents
   
  Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
  Set objPane = Application.ActiveExplorer.NavigationPane
  Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
   
  With objModule.NavigationGroups
  Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
 
  ' To use a different group
  ' Set objGroup = .Item("group name")
  End With
 
 
  For i = 1 To objGroup.NavigationFolders.Count
  Set objNavFolder = objGroup.NavigationFolders.Item(i)
  Select Case i
 
  ' Enter the calendar index numbers you want to open
  Case 2
  objNavFolder.IsSelected = True
   
  ' Set to True to open side by side
  objNavFolder.IsSideBySide = False
  Case Else
  objNavFolder.IsSelected = False
  End Select
  Next
  End If
  Set objPane = Nothing
  Set objModule = Nothing
  Set objGroup = Nothing
  Set objNavFolder = Nothing
  Set objCalendar = Nothing
  Set objFolder = Nothing
End Sub
 
Because the calendar is the startup folder, you can select the folder in the start up routine- this woks and assumes the calendar you want opened is the second one.

Because its a shared calendar, it doesn't open fast enough to deselect the first calendar (and doevents doesn't slow it down enough) but you might be able to deselect if the calendar you want opened is cached in the profile.

This code opens the second calendar, overlaid and as the in focus calendar.

Code:
Private Sub Application_Startup()
  Dim objPane As NavigationPane
  Dim objModule As CalendarModule
  Dim objGroup As NavigationGroup
  Dim objNavFolder As NavigationFolder
 
  Set objPane = Application.ActiveExplorer.NavigationPane
  Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
 
  With objModule.NavigationGroups
  Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
  End With
On Error Resume Next
Set objNavFolder = objGroup.NavigationFolders.Item(2)
DoEvents
objNavFolder.IsSelected = True
objNavFolder.IsSideBySide = False
DoEvents
Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = False

  End Sub
 
Because the calendar is the startup folder, you can select the folder in the start up routine- this woks and assumes the calendar you want opened is the second one.

Because its a shared calendar, it doesn't open fast enough to deselect the first calendar (and doevents doesn't slow it down enough) but you might be able to deselect if the calendar you want opened is cached in the profile.

This code opens the second calendar, overlaid and as the in focus calendar.

Code:
Private Sub Application_Startup()
  Dim objPane As NavigationPane
  Dim objModule As CalendarModule
  Dim objGroup As NavigationGroup
  Dim objNavFolder As NavigationFolder

  Set objPane = Application.ActiveExplorer.NavigationPane
  Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)

  With objModule.NavigationGroups
  Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
  End With
On Error Resume Next
Set objNavFolder = objGroup.NavigationFolders.Item(2)
DoEvents
objNavFolder.IsSelected = True
objNavFolder.IsSideBySide = False
DoEvents
Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = False

  End Sub


Hello Diane,
thats it- thank you.
After activating the Exchange cache mode it works.
So now we have laptops in front of the conference rooms (in a box where only the display is shown), they are starting with wakeonlan, autologin and Outlook in autostart with calendar view of the shared calendar (room resource).
Thank you for help.
Thorsten
 
My guess is that it didn't work in online mode because of the delay in loading the shared calendar. You'd need to build in a pause to wait a few seconds for it run the code because Outlook itself does not include a timer.
 
It is fine like it is now. Thank you again for quick help.
It was easier before when were allowed to use a normal user account for the conference calendar, but now with the resource room calendar it is also working because of your script.
Thorsten
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
F Show events in Monthly Calendar Using Outlook 3
J Hotmail drafts started on desktop disappear, but show in web version of Outlook Using Outlook 4
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
S Related messages show in main Outlook window vice new Advanced Find windows Using Outlook 1
M New Calendar Appointments: Conditionally turn off reminder and show time as free Using Outlook 14
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
N Outlook 365 How to show all calendars at startup? Outlook VBA and Custom Forms 0
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
R Sent emails show iCloud mail account not the alias Using Outlook 2
J Names in sent items suddenly show as Bob Smith (bobsmith@sample.com) Using Outlook 3
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
Horsepower Contacts added from iPhone don't show up in Outlook Using Outlook 2
C All Gmails don't show in Outlook 2019 Using Outlook 2
C How to use VBA to show only items x days old or more Outlook VBA and Custom Forms 1
L Option to Show Cancelled Appointments Using Outlook 0
Z How to show concatenated categories in list task view? Using Outlook 2
M Outlook .com group does not show up in Outlook for office 365 home Using Outlook 3
F Appointment Show All Fields Using Outlook 1
G Calendar View in Outlook Office 365 - Doesn't show enough hours, and the 30/60 min choice isn't the solution Using Outlook 4
N How to disable shortcuts for Pilcrow in Outlook (Show or hide paragraph marks) Using Outlook 0
V Outlook Macro to show Flagged messages Outlook VBA and Custom Forms 2
F How to show assigned tasks under certain mailbox? Using Outlook 4
Witzker social connector 2010 does not show all emails to or from contact Using Outlook 3
Witzker social connector 2010 does not show all emails to or from contact Using Outlook 0
S Outlook.com birthdays show up 1 day late on iPhone contacts list Using Outlook.com accounts in Outlook 27
A Outlook 2016 Will Not Show Any Data In the People Pane Using Outlook 17
Rupert Dragwater Email flag does not show up in Outlook2013 Using Outlook 13
S Show Total Number Of Items Not Displaying Using Outlook 9
Z Tasks from some users show up as emails Using Outlook 4
Caio "From" field doesn't show extra email addresses in Outlook 2016. Using Outlook.com accounts in Outlook 6
O Worksheet doesn't show on jumplist Using Outlook 1
J Outlook 2013 when clicking To in a new email show Company names Using Outlook 0
C Outlook 2016 doesn't show contacts in address book Using Outlook 2
K Daily task list > show tasks on the exact due date and not on the "current date" Using Outlook 1
Rupert Dragwater Some mailboxes show deleted items as not read Using Outlook 5
C Discovery search does not show autoforwarded messages Exchange Server Administration 1
M Marco doesn't show up when using Alt-F8 Outlook VBA and Custom Forms 2
I Windows 10 - .msg files on disk show Explorer popup error Using Outlook 5
Phillip Show mail items in folder macro Outlook VBA and Custom Forms 2
H How to show recipient email address? Using Outlook 0
H Is it possible to create a view that only show the first task in a list? Using Outlook 1
Diane Poremsky Make the Address Book show only e-mail addresses, not fax numbers Using Outlook 0
G Outlook does not show new appointments in To-Do-Bar Using Outlook 0
L How to show Delivered-To field in Inbox Using Outlook 1
T Desktop alerts show but no emails found Using Outlook 1
oliv- How to select an mailitem in explorer with "show as conversation" Outlook VBA and Custom Forms 8
N To do bar - show more than 30 days of appointments Using Outlook 0
V move emails to windows folder and show sender details Using Outlook 7
M No Show Group on ribbon Using Outlook 8
J Outlook Rules not show Master Category List Using Outlook.com accounts in Outlook 4

Similar threads

Back
Top