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
 

Thorsten

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

Thorsten

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 

Thorsten

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
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.
Thread starter Similar threads Forum Replies Date
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
B 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 New Slipstick.com Articles 0
S Outlook.com birthdays show up 1 day late on iPhone contacts list Using Outlook.com accounts in Outlook 29
A Outlook 2016 Will Not Show Any Data In the People Pane Using Outlook 14
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 New Slipstick.com Articles 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
A Show ALL of today's appointments in To-Do Bar Using Outlook 1
D Mail accounts don't show up in navigation pane Using Outlook 1
wisedave Missing icon that show message was forwarded, etc Using Outlook 1
S Need CC: to show the original To: recip[ients Using Outlook 4
C iCloud addresses don't show up in "Address Book" or "To:" Using Outlook 5
J Show three or more months in Calendar Using Outlook 1
U Subdirectories in people don't show up in the address book Using Outlook 1
1Firefly Outlook 2013 Converstation preview does not show my last reply Exchange Server Administration 1
J How to show the "value" of a user-defined Account field in a Contact Record BCM (Business Contact Manager) 2
D Setting defult "Show a room list" Using Outlook 0
D Custom Form - Show field-filled doc a or b based on value of field x Outlook VBA and Custom Forms 4
T Error" There are no items to show in this view" for Outlook 2007 with 16GB pst Using Outlook 2
D How to show just the date in an Outlook 2010 Journal view Using Outlook 1
Similar threads


















































Top