A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Turn off reminders programatically



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 21st 08, 06:31 PM posted to microsoft.public.outlook.program_vba
Adrian[_2_]
external usenet poster
 
Posts: 18
Default Turn off reminders programatically

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  
Old February 21st 08, 08:06 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Turn off reminders programatically

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  
Old February 22nd 08, 05:38 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Turn off reminders programatically



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  
Old February 22nd 08, 09:28 AM posted to microsoft.public.outlook.program_vba
Adrian[_2_]
external usenet poster
 
Posts: 18
Default Turn off reminders programatically

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  
Old February 23rd 08, 12:56 PM posted to microsoft.public.outlook.program_vba
Adrian[_2_]
external usenet poster
 
Posts: 18
Default Turn off reminders programatically

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  
Old February 25th 08, 06:20 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Turn off reminders programatically



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  
Old February 25th 08, 07:59 PM posted to microsoft.public.outlook.program_vba
Adrian[_2_]
external usenet poster
 
Posts: 18
Default Turn off reminders programatically

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  
Old February 26th 08, 05:40 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Turn off reminders programatically



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  
Old February 26th 08, 08:27 PM posted to microsoft.public.outlook.program_vba
Adrian[_2_]
external usenet poster
 
Posts: 18
Default Turn off reminders programatically

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 05:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.