Free/Busyįirst: You need to have macro security set to the lowest setting, Enable all macros during testing. Use If InStr(1, test, "2") or InStr(1, test, "3") Then to check for Busy and Out of Office. If you want to check for specific values or consider tentative appointments as Free, you can change If InStr(1, test, "1") Then to use different values.
Test = Mid(myFB, i - 2, (oAppt.Duration / 5) + 2) MyFB = myAcct.FreeBusy(oAppt.Start, 5, False) If Time + 0.3333333 "" Thenĭebug.Print "Time: " & TimeValue(oAppt.Start)ĭebug.Print "periods before appt: " & TimeValue(oAppt.Start) * 288 Tip: If your lead time has many decimal places, the more you use, the more accurate the time, however, 5 to 6 decimal places should be accurate within a few seconds. You can use either decimal points (Time + 0.333333) for the time difference or divide by hours or minutes: Time + 8/24 (or 480/1440). For this example, it is configured for 8 hours. This version of the macro will decline the meeting request if the meeting is on short notice. Set oResponse = oAppt.Respond(olMeetingDeclined, True) Meetingtime = Format(oAppt.Start, "h:mm:ss AM/PM") Sub AcceptWorkingHours(oRequest As MeetingItem) Meetings during those times will be accepted. Any meetings before your working time or after your day ends, you be declined. Use this macro to accept meetings only during your working hours. Sub AutoAcceptMeetingsWed(oRequest As MeetingItem)
#Remove office for mac 2011 script full
Use the full weekday name in the string.ĭayWed = WeekdayName(Weekday(oAppt.Start)) This edit uses the WeekDayName function to get the day of the week and automatically process the meeting. It can either go right after the 'Set oAppt' line or before End Sub.Īpply rule to meetings scheduled for a specific day of the week
To turn reminders off on the meeting, add these lines to the code. Set newCalFolder = Session.GetDefaultFolder(olFolderCalendar).Folders("New") See Working with VBA and non-default Outlook Folders for the methods needed to move it to other calendar folders.īecause moving a meeting adds Copy to the subject, it picks up the original subject and replaces the subject with it after the move. This run a script macro accepts the meeting then moves it to another calendar (a subfolder of the default calendar as written). Move meeting to a new calendar after accepting This version looks for the meeting acceptance message and adds a category to the meeting, allowing you to see at a glance if it was accepted. ' if not deleted, may create tentative appt on calendarĪdd a Category when the meeting is accepted ' creates response, saves to drafts without sending The difference between the two is that olSave saves a draft of the acceptance (or decline) and if you don't delete it using the Delete line, a tentative appointment may be added to the calendar. To accept the meeting and add it to your calendar automatically, without sending a response, one of two options should work to suppress the response: Set oResponse = oAppt.Respond(olMeetingDeclined, True) To Save with no response sent To decline a meeting, replace olMeetingAccepted with olMeetingDeclined:
#Remove office for mac 2011 script code
Type or paste the code into the module, then create the rule with the 'run script' Action and select this script Open Outlook's VBA editor (Alt+F11), expand Microsoft Office Outlook Objects then double click on ThisOutlookSession. Set oResponse = oAppt.Respond(olMeetingAccepted, True) Set oAppt = oRequest.GetAssociatedAppointment(True) Sub AutoAcceptMeetings(oRequest As MeetingItem) This was tested in Outlook 2007 and should work in any version which supports the Run a Script action. Outlook MVP Michal Bednarz offers this script, which you need to add to ThisOutlookSession before creating the rule.
Since there is not an action to respond to meeting requests, you'll need to use a script to accept it.