New Calendar Appointments: Conditionally turn off reminder and show time as free

Matt Metz

Member
Outlook version
Outlook 365 64 bit
Email Account
IMAP
Because most of the items on my calendar are for me, my default settings for new appointments are SHOW AS: BUSY and REMINDER: 45 MINUTES.

But I also put appointments for my wife on my calendar, but only as FYI for myself. I want them on my calendar, but I want them to ALWAYS be shown as SHOW AS: FREE and REMINDER: NONE.

I have used VIEW SETTINGS: CONDITIONAL FORMATTING so that appointments that contain CM (my wife's initials) in the subject are formatted as gray. But I would like Outlook to conditionally also look for CM in the subject and if found, set the SHOW AS to FREE and the REMINDER to NONE.

Is there a way to do this?

If it requires a VBA macro, can you suggest how it might be done?

PS: For reasons too complicated to go into here, I prefer NOT to set up a different calendar file for my wife.
 
It will require a macro.

This can be used as the base - then use an if statement to check the subject and if it matches, set the show as value.


Code:
'Checks to see if all day and if it has a reminder set to true
     If instr(1, Appt.subject, "CM") >0 then 

With appt
     .busystatus= olfree 
     .ReminderSet = False
     .Save
end with
    End If
 
Diane Poremsky, you have been my hero for so long. Thank you for all you have contributed over many years to our collective "Outlook Quality of Life."

If I understand correctly, I think you are saying my entire VBA Macro code will read as follows. I've removed the prompt because I don't want to be asked each time. Do I have this right?

With great appreciation,

Matt
--------------------------------
Private Sub Items_ItemAdd(ByVal Item As Object)
On Error Resume Next
Dim Appt As Outlook.AppointmentItem

If TypeOf Item Is Outlook.AppointmentItem Then

Set Appt = Item

'Checks to see if appt subject includes "CM"
If instr(1, Appt.subject, "CM") > 0, then

With appt
.busystatus= olfree
.ReminderSet = False
.Save

End If
End If
End Sub
-----------------------------------------
 
I think another argument is needed in the instr function, and there's a superfluous comma. I think it should read
If instr(1, Appt.subject, "CM", 1) > 0 then
 
The last property is compare - it's optional.

Default is binary, which is case sensitive. It will only find CM, not cm.

Text (value 1) will match both CM and cm.
 
Diane,

After setting up my new computer (now Windows 11 Pro) and installing Microsoft 365, this macro is only doing one-half of what it was doing on the old computer. For new appointments with CM in the subject, it IS setting the time as free, but it is NOT turning off the reminder. It's leaving the reminder at the 45 minute default value. Do you know what might be causing this new behavior?

Here is the script as it is today, in This Outlook Session:

Private Sub Items_ItemAdd(ByVal Item As Object)
On Error Resume Next
Dim Appt As Outlook.AppointmentItem

If TypeOf Item Is Outlook.AppointmentItem Then

Set Appt = Item

'Checks to see if appt subject includes "CM"
If InStr(1, Appt.Subject, "CM", 1) > 0 Then
Appt.BusyStatus = olFree
Appt.ReminderSet = False
Appt.Save
End If
End If
End Sub
 
Diane, this macro is not working at all now. It is NOT setting the time as free, and is NOT turning off the reminder. The same macro is working properly still on my W10 machine, but not in W11.
 
The last property is compare - it's optional.

Default is binary, which is case sensitive. It will only find CM, not cm.

Text (value 1) will match both CM and cm.
Diane, the VBA code you helped me set up in Outlook to conditionally turn off reminder and show time as free for any appointment with "CM" in the subject was working just fine on my Windows 10 machine. The same code, replicated to my Windows 11 machine, does not work. Do you know why this is and/or how to fix it?
 
Is it not working at all or only working half? Did you move the entire script or just the code you posted above? You need the app startup too. Depending on how you opened the new appt form, it could already be set to Free.

Code:
Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
  Dim Ns As Outlook.NameSpace

  Set Ns = Application.GetNamespace("MAPI")
  Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
On Error Resume Next
Dim Appt As Outlook.AppointmentItem

If TypeOf Item Is Outlook.AppointmentItem Then

Set Appt = Item

'Checks to see if appt subject includes "CM"
If InStr(1, Appt.Subject, "CM", 1) > 0 Then
Appt.BusyStatus = olFree
Appt.ReminderSet = False
Appt.Save
End If
End If
End Sub



It's working here -
1718856641172.png




It will show the default remind beforehand time in the list view - but the reminder icon is not present, so it won't go off.

1718856965257.png
 
Similar threads
Thread starter Title Forum Replies Date
A Outlook 365 New Appointments All saved to a 365 default calendar on Mac Using Outlook 0
Kika Melo Outlook Calendar deleted appointments not in Deleted Items folder Using Outlook 3
e_a_g_l_e_p_i Outlook 2021 all appointments not showing in calendar Using Outlook 2
M Calendar daily Appointments and printing Using Outlook 0
O Export Outlook calendar appointments by filters and date range Outlook VBA and Custom Forms 1
N Gathering Calendar Appointments from Calendars that synced as Contacts Exchange Server Administration 1
V importing appointments to non-default calendar? Using Outlook 1
R Make past appointments remain in calendar Using Outlook 1
T populate calendar with appointments and send reminders Using Outlook 1
Diane Poremsky Copy New Appointments to Another Calendar using VBA Using Outlook 0
Diane Poremsky How to Import Appointments into a Group Calendar Using Outlook 0
M Copy new appointments created in multiple shared calendars to another exchange calendar Outlook VBA and Custom Forms 1
R Outlook calendar appointments Free/Busy time is changing from "Busy" to "Free" Using Outlook 2
A Looping appointments in calendar Outlook VBA and Custom Forms 0
B Outlook Calendar/setting appointments Using Outlook 1
F Outlook 2007 Calendar Appointments not in Outlook Today view Using Outlook 11
N Outlook Shared appointments automatically to Private Calendar Using Outlook 1
A Synchronize Access Table with Outlook Calendar Appointments Outlook VBA and Custom Forms 3
I Adding appointments/tasks to other user's calendar Using Outlook 1
R Getting a colleagues appointments and calendar entries Using Outlook 1
Katrina Fox Missing appointments on calendar even though transferred from old pst Using Outlook 0
Horsepower Setting appointments in calendar Using Outlook 3
A OL13 Calendar, won't allow entering 2 appointments consecutively Using Outlook 4
R New computer, OL2010 unable to display shared calendar appointments Exchange Server Administration 3
C Calendar is not accepting Appointments Using Outlook 0
A Suggestions on ways to let apps create appointments in any user's calendar? Exchange Server Administration 0
D Priting only Recurring Appointments in Outlook Calendar 2010 Using Outlook 1
L Shared calendar appointments received as emails, stays in inbox! Using Outlook 1
Z Calendar Appointments Using Outlook 1
G Can't see all my appointments on Outlook calendar Using Outlook 2
R Copy Appointments to Another Exchange Calendar Using Outlook 23
Horsepower Default calendar to receive email appointments Using Outlook 5
J Calendar Appointments move when Computer Time Zone changed. Using Outlook 5
U Appointments items not showing in calendar Using Outlook 2
A Delete all appointments on calendar for week of holiday / annual leave Using Outlook 1
J Default Category foo Calendar Appointments Using Outlook 1
M Outlook Calendar Monthly View Missing Appointments Using Outlook 3
D appointments on To Do Bar don't reflect the correct Calendar Using Outlook 3
R Shared Public calendar folder changing appointments Using Outlook 1
S exceptions to recurring appointments in calendar Using Outlook 1
K Calendar Appointments after a change of Domain Controller Exchange Server Administration 0
L Block others from inserting appointments in your calendar Using Outlook 3
R Populate Form with appointments from Calendar Outlook VBA and Custom Forms 1
F Import Calendar appointments from CSV file Outlook VBA and Custom Forms 3
R outlook 2010 calendar appointments Using Outlook 2
H i ditect birthday appointments from calendar appointments Outlook VBA and Custom Forms 4
S hide details of appointments in calendar Using Outlook 8
A Calendar private appointments, an unresolved question... Outlook VBA and Custom Forms 3
O Any 3rd party tool that sync (mirror) from Outlook Calendar to Google Calendar? Using Outlook 5
Fozzie Bear Calendar Events created on iPhone have suddenly start sending invitations to attendees Using Outlook 2

Similar threads

Back
Top