![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Outlook 2007 SP1/Exchange 2007
I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
Ads |
#2
|
|||
|
|||
![]()
There's 2 ways to do this:
1) Use a rule to run a script (How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...en-us;q306108). When your function fires, you'll have to call NameSpace.GetDefaultFolder(olFolderCalendar) to get a MAPIFolder object. Then use Find or Restrict with MAPIFolder.Items to look for the Appointment Item that was created in the Calendar as soon as the message was delivered to your Inbox. You'll probably have to compare not only the Subject properties, but also Start and End to guarantee you get the correct event. Once you have the AppointmentItem object, set ReminderSet to False and Save. 2) Instead of a rule, monitor the ItemAdd event for your Calendar. You can do this by grapping the Items collection object for the Calendar during Application_Startup, and use a module level var for Items that uses the WithEvents keyword so you can trap the event. When the event fires, you can clear ReminderSet for all new appointments, or just for ones that have not been accepted or rejected. Let me know if you have any questions. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Adrian" wrote: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#3
|
|||
|
|||
![]() Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#4
|
|||
|
|||
![]()
Thanks for your suggestions.
I will have a look at this and let you know how I get on. Adrian "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#5
|
|||
|
|||
![]()
Michael,
I just pasted your example code into 'This OutlookSession' but nothing seems to happen. What have I done wrong? Thanks again for your help. Adrian. "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#6
|
|||
|
|||
![]() After any changes you need to call the Application_Startup procedure. That's automatically done when you restart Outlook. Additionally, set the security settings (Tools/Macro/Security) so that VBA is executed at all. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sat, 23 Feb 2008 12:56:59 -0000 schrieb Adrian: Michael, I just pasted your example code into 'This OutlookSession' but nothing seems to happen. What have I done wrong? Thanks again for your help. Adrian. "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#7
|
|||
|
|||
![]()
Michael,
Thanks for your advice. Below is the code I have. It is running the Application_Startup but never runs Items_ItemAdd. Any ideas? ++++++++++++++++++++++++++++ Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("MAPI") Set Items = Ns.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub Items_ItemAdd(ByVal Item As Object) On Error Resume Next Dim Meet As Outlook.MeetingItem Dim Appt As Outlook.AppointmentItem If TypeOf Item Is Outlook.MeetingItem Then Set Meet = Item Meet.ReminderSet = False Meet.Save Set Appt = Meet.GetAssociatedAppointment(True) If Not Appt Is Nothing Then Appt.ReminderSet = False Appt.Save End If End If End Sub ++++++++++++++++++++++++++++ Thanks, Adrian "Michael Bauer [MVP - Outlook]" wrote in message ... After any changes you need to call the Application_Startup procedure. That's automatically done when you restart Outlook. Additionally, set the security settings (Tools/Macro/Security) so that VBA is executed at all. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sat, 23 Feb 2008 12:56:59 -0000 schrieb Adrian: Michael, I just pasted your example code into 'This OutlookSession' but nothing seems to happen. What have I done wrong? Thanks again for your help. Adrian. "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#8
|
|||
|
|||
![]() Where do you know from that ItemAdd is not running? If you did not do that already, set a breakpoint on the Private Sub Items_ItemAdd line (f9). Then receive a MeetingItem into your Inbox, the code execution should stop at the breakpoint. you can then walk trough it with f8 step by step and watch what happens. ItemAdd fires only if Outlook is running while items come in and if it's not more than 16 items at once. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 25 Feb 2008 19:59:29 -0000 schrieb Adrian: Michael, Thanks for your advice. Below is the code I have. It is running the Application_Startup but never runs Items_ItemAdd. Any ideas? ++++++++++++++++++++++++++++ Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("MAPI") Set Items = Ns.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub Items_ItemAdd(ByVal Item As Object) On Error Resume Next Dim Meet As Outlook.MeetingItem Dim Appt As Outlook.AppointmentItem If TypeOf Item Is Outlook.MeetingItem Then Set Meet = Item Meet.ReminderSet = False Meet.Save Set Appt = Meet.GetAssociatedAppointment(True) If Not Appt Is Nothing Then Appt.ReminderSet = False Appt.Save End If End If End Sub ++++++++++++++++++++++++++++ Thanks, Adrian "Michael Bauer [MVP - Outlook]" wrote in message ... After any changes you need to call the Application_Startup procedure. That's automatically done when you restart Outlook. Additionally, set the security settings (Tools/Macro/Security) so that VBA is executed at all. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sat, 23 Feb 2008 12:56:59 -0000 schrieb Adrian: Michael, I just pasted your example code into 'This OutlookSession' but nothing seems to happen. What have I done wrong? Thanks again for your help. Adrian. "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
#9
|
|||
|
|||
![]()
Michael,
Thank you for your patience. It is now working. Although I had tested it with items coming in, I suspect that was before I changed the security. For some reason I thought it ran when Outlook opened, and I had been testing that. Just one quick final question please. I wanted to only turn off reminders for all day events so I tried 'If Appt.AllDayEvent = True Then...', but Appt.AllDayEvent seems to remain False for All Day Events. Why is that? I have worked around this by testing if Appt.Duration = 1440 and this seems to work. Thanks again. Adrian If I receive an All Day Appointment "Michael Bauer [MVP - Outlook]" wrote in message ... Where do you know from that ItemAdd is not running? If you did not do that already, set a breakpoint on the Private Sub Items_ItemAdd line (f9). Then receive a MeetingItem into your Inbox, the code execution should stop at the breakpoint. you can then walk trough it with f8 step by step and watch what happens. ItemAdd fires only if Outlook is running while items come in and if it's not more than 16 items at once. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Mon, 25 Feb 2008 19:59:29 -0000 schrieb Adrian: Michael, Thanks for your advice. Below is the code I have. It is running the Application_Startup but never runs Items_ItemAdd. Any ideas? ++++++++++++++++++++++++++++ Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("MAPI") Set Items = Ns.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub Items_ItemAdd(ByVal Item As Object) On Error Resume Next Dim Meet As Outlook.MeetingItem Dim Appt As Outlook.AppointmentItem If TypeOf Item Is Outlook.MeetingItem Then Set Meet = Item Meet.ReminderSet = False Meet.Save Set Appt = Meet.GetAssociatedAppointment(True) If Not Appt Is Nothing Then Appt.ReminderSet = False Appt.Save End If End If End Sub ++++++++++++++++++++++++++++ Thanks, Adrian "Michael Bauer [MVP - Outlook]" wrote in message ... After any changes you need to call the Application_Startup procedure. That's automatically done when you restart Outlook. Additionally, set the security settings (Tools/Macro/Security) so that VBA is executed at all. -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sat, 23 Feb 2008 12:56:59 -0000 schrieb Adrian: Michael, I just pasted your example code into 'This OutlookSession' but nothing seems to happen. What have I done wrong? Thanks again for your help. Adrian. "Michael Bauer [MVP - Outlook]" wrote in message .. . Here's a sample for the ItemAdd approach: http://www.vboffice.net/sample.html?...item&lang=e n -- Best regards Michael Bauer - MVP Outlook Use Outlook Categories? This is Your Tool: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 21 Feb 2008 18:31:16 -0000 schrieb Adrian: Outlook 2007 SP1/Exchange 2007 I want to programmatically turn off reminders for all 'all day' events that I receive. Can anyone give me some guidance of how I might do this. I have some experience of using VBA, but none with Outlook. Thanks for any help. Adrian |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I turn off reminders (no "Advanced" choice)? | Roger Freeman | Outlook - Installation | 6 | August 8th 07 06:14 AM |
Get PST Display Name programatically | [email protected] | Outlook and VBA | 1 | March 21st 07 01:43 PM |
Turn reminders into taks and Outlook reminders in folders | friedbeef | Outlook - General Queries | 1 | June 16th 06 02:24 PM |
Turn off reminders | pdx | Outlook - Calandaring | 2 | February 15th 06 08:57 PM |
Turn off calendar reminders | Rob in York | Outlook - Calandaring | 1 | January 18th 06 07:54 PM |