Wayne Dardis
New Member
- Outlook version
- Outlook 2016 32 bit
- Email Account
- Exchange Server 2013
I am not a VBA programmer. The following is the main sub of a project that I cobbled together for Outlook 2007 and was pleased to find it worked for Outlook 2010 a few years later. However, we are moving to Outlook 2016 now and I've found that it does not work as intended.
We have displays outside our meeting rooms that show the schedules for those rooms in the form of Outlook calendars. I've set a recurring appointment with a reminder just after midnight every day. The reminder event triggers this code. From what I've seen, I think that trigger part still works because "ReminderObject.Dismiss" seems to dismiss the reminder. (I don't see it pop up at all.) However, the main purpose of the code fails, and that is to switch the calendar view to the current date, "Go To Today."
I think this might have something to do with the "Go To Today" button existing on the Ribbon or Home Tab or Whateveritiscallednow instead of on the old command menu. So, maybe the syntax of "objExpl.CommandBars.FindControl" etc. has to change?
From what I picked up from Download Office 2016 Help Files: Office Fluent User Interface Control Identifiers from Official Microsoft Download Center , outlookexplorercontrols.xlsx , Row 187 ... The ID for "Today" is still "5497."
Anyway here is the sub as originally cobbled together. Maybe just looking at it will make my trouble clear to someone fluent in this language...
--- --- --- ---
Private Sub m_colReminders_ReminderFire(ByVal ReminderObject As Outlook.Reminder)
--- --- --- ---
Thank you in advance for your time and assistance!
We have displays outside our meeting rooms that show the schedules for those rooms in the form of Outlook calendars. I've set a recurring appointment with a reminder just after midnight every day. The reminder event triggers this code. From what I've seen, I think that trigger part still works because "ReminderObject.Dismiss" seems to dismiss the reminder. (I don't see it pop up at all.) However, the main purpose of the code fails, and that is to switch the calendar view to the current date, "Go To Today."
I think this might have something to do with the "Go To Today" button existing on the Ribbon or Home Tab or Whateveritiscallednow instead of on the old command menu. So, maybe the syntax of "objExpl.CommandBars.FindControl" etc. has to change?
From what I picked up from Download Office 2016 Help Files: Office Fluent User Interface Control Identifiers from Official Microsoft Download Center , outlookexplorercontrols.xlsx , Row 187 ... The ID for "Today" is still "5497."
Anyway here is the sub as originally cobbled together. Maybe just looking at it will make my trouble clear to someone fluent in this language...
--- --- --- ---
Private Sub m_colReminders_ReminderFire(ByVal ReminderObject As Outlook.Reminder)
Dim objOL As Outlook.Application
Dim objExpl As Outlook.Explorer
Dim objCBB As Office.CommandBarButton
Const cbbThisDayID = 5497
On Error Resume Next
Dim objExpl As Outlook.Explorer
Dim objCBB As Office.CommandBarButton
Const cbbThisDayID = 5497
On Error Resume Next
Set objOL = CreateObject("Outlook.Application")
Set objExpl = objOL.ActiveExplorer
If objExpl.CurrentFolder.DefaultItemType = olAppointmentItem Then
Set objOL = Nothing
Set objExpl = Nothing
Set objCBB = Nothing
ReminderObject.Dismiss
End SubSet objExpl = objOL.ActiveExplorer
If objExpl.CurrentFolder.DefaultItemType = olAppointmentItem Then
Set objCBB = objExpl.CommandBars.FindControl(, cbbThisDayID)
objCBB.Execute
End IfobjCBB.Execute
Set objOL = Nothing
Set objExpl = Nothing
Set objCBB = Nothing
ReminderObject.Dismiss
--- --- --- ---
Thank you in advance for your time and assistance!