Solved

Automatically reject meeting requests by time

Posted on 2011-02-10
7
1,290 Views
Last Modified: 2012-06-22
How can I make outlook 2007 automatically reject meeting/invites requests by time.

There are folks in my company that tries to slip in a meeting into my calendar after my work hours.
People in different depts tend to have varying official working hours. But my calendar is normally so booked up during the day that some people try to book me for meetings as late as midnite.

It would be a bonus if I can reject meeting requests at specific times - like my lunch time.

The Resource Scheduling under Calendar options doesn't help because it forces me to also automatically accept meetings. which I don't ever want to do. I realize outlook does not readily provide such a feature.
but in  this related question, BlueDevilFan had a solution to reject meeting from outside a domain. Can a similar solution be found for my question?

thanks in advance
0
Comment
Question by:pengster
  • 3
  • 2
7 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 34867625
Hi, pengster.

Yes, that's possible.  The code below should do what you've described.  Yo can change the times as needed.
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
    Dim rrEID As Variant, varEID As Variant, olkItm As Object, olkAppointment As Outlook.AppointmentItem
    arrEID = Split(EntryIDCollection, ",")
    arrWords = Split(KILL_WORDS, ",")
    For Each varEID In arrEID
        Set olkItm = Session.GetItemFromID(varEID)
        If olkItm.Class = olMeetingRequest Then
            Set olkAppointment = olkItm.GetAssociatedAppointment(False)
            If DatePortion(olkAppointment.Start) = DatePortion(olkAppointment.End) Then
                If TimePortion(olkAppointment.Start) <= #1:00:00 PM# And TimePortion(olkAppointment.End) >= #12:00:00 PM# Then
                    olkAppointment.Respond olMeetingDeclined
                End If
            End If
        End If
    Next
End Sub

unction DatePortion(datValue As Date) As Date
    DatePortion = Format(datValue, "dd/mm/yyyy")
End Function

Function TimePortion(datValue As Date) As Date
    TimePortion = Format(datValue, "hh:mm:ss")
End Function

Open in new window

0
 

Author Comment

by:pengster
ID: 34890344
Hi BlueDevilFan,

Thanks very much for the VB script.
Silly me. i spent the last few days trying to figure out how to get this script into my outlook only to find out you had given a step-by-step howto in the other related question. lol.

Needless to say I'm a noob at VB scripts and it's probably because of that I couldn't get your script to work. I know enough programming to correct the "unction" to "Function" in the script. But beyond that I'm lost.

I tried replacing the #12:00:00 PM# with "12:00:01" and #12:00:01PM#. Neither worked.
I tried a few other combinations with quotes, 12hr vs 24hr formats, etc. None seems to work.
I'm probably too noobie to figure out the correct way to specify the time.

Each time a meeting is send to me at 12:00:01 pm. I get the meeting request with the accept/decline buttons. But the Sender does not get a "Declined" reply. I have to physically decline it before the Sender gets the decline.

what could I be doing wrong?
Thanks
pengster


0
 
LVL 76

Expert Comment

by:David Lee
ID: 34891511
You're welcome, pengster.

Sorry about the "unction" typo.  

The way it's set up now it will decline any appointment that starts and ends on the same day where any portion of the appointment is between 12:00 PM and 1:00 PM.  I tested it before posting, so I know it works.  Are you sure that macros are enabled and working?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:pengster
ID: 34900619
How can I verify the macro is enabled/running?
I can see the script inside the Macro Editor after I restart outlook 2007.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34901243
Add a command like

    Msgbox "Script fired"

immediately after line #2 of Application_NewMailEx.  When new messages arrive a dialog-box should popup saying "Script fired".
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 37373012
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Read this checklist to learn more about the 15 things you should never include in an email signature.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question