Solved

Automatically reject meeting requests by time

Posted on 2011-02-10
7
1,244 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exhange 2010 10 54
excel exchange 7 39
Sharing a calendar in Outlook non Exchange Environment. 5 43
Outlook Contacts not exporting to CSV/.xls with phone numbers 3 15
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

809 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