Rules for Calendar?

  • Thread starter Thread starter Bob Sisson
  • Start date Start date
B

Bob Sisson

I've asked before, and got a short "can't do that" answer....

I want RULES for Calendar items....

Ie,
"If criteria Met" (from, subject, no conflict, etc...) then (accept & send,
mark, label, reply...) and then (stop processing, beep, move, etc....)

I am sure someone could do it with a macro and VB, but I haven't programmed
since the days of (gasp) Pascal and plain C.

Any help of direction would be appreciated....

Bob
 
I'm a little confused. Your subject says "Rules for Calendar," which sounds like the Calendar folder, but your post indicates you might be looking specifically to handle incoming meeting requests. If so, yes, that can be done with a "run a script" rule and a VBA procedure that looks like this:

Sub ConvertHTMLToPlain(MyMtg As MeetingItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMtg As Outlook.MeetingItem
Dim olAppt as Outlook.AppointmentItem
Dim olMtgResponse as Outlook.MeetingItem

strID = MyMtg.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMtg = olNS.GetItemFromID(strID)

' do stuff with olMtg
' like add the appointment to the calendar
' and send a response
Set olAppt = olMtg.GetAssociatedAppointment(True)
Set olMtgResponse = olAppt.Respond(olResponseAccepted, True)
olMtgResponse .Send

Set olMtg = Nothing
Set olAppt = Nothing
Set olMtgResponse = Nothing
Set olNS = Nothing
End Sub

Obviously, there's a lot potentially more to it than that if you want to check for conflicting appointments (see http://www.outlookcode.com/d/finddate.htm for examples on searching a date range).

If you're new to Outlook VBA macros, these web pages should help you get started:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm

There is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
 
Back
Top