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

Tags: , , ,

close reminder window programatically





 
 
Thread Tools Display Modes
  #1  
Old February 4th 08, 05:15 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default close reminder window programatically

Hi All,

I cannot find the way that close reminder window programatically.

I found dismiss method here.
http://msdn2.microsoft.com/en-us/library/bb176766.aspx
But I cannot find close method...

basically, I want these,
1 call sql query at once reminder fire - done
2 change the label of item - done
3 close reminder window

Please, advice me!

Thanks,
soworl
Ads
  #2  
Old February 4th 08, 06:16 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,404
Default close reminder window programatically

There's no method of closing the window when it's opened. You can intercept
the event when a reminder fires and prevent the window from opening in the
first place. Once it's opened you would have to use FindWindow() or some
other Win32 API calls to get the window handle for the Reminders window and
then send it a WM_CLOSE message, again using Win32 API calls.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
Hi All,

I cannot find the way that close reminder window programatically.

I found dismiss method here.
http://msdn2.microsoft.com/en-us/library/bb176766.aspx
But I cannot find close method...

basically, I want these,
1 call sql query at once reminder fire - done
2 change the label of item - done
3 close reminder window

Please, advice me!

Thanks,
soworl


  #3  
Old February 4th 08, 06:42 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default close reminder window programatically

Thanks Ken,

Can you give me a useful link for intercept the event & prevent open
reminder window?

for your info, Here is my code
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first parameter=milliseconds
' I'll add sql query here
SetApptColorLabel Item, 5
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''

Thanks,
soworl
"Ken Slovak - [MVP - Outlook]" wrote:

There's no method of closing the window when it's opened. You can intercept
the event when a reminder fires and prevent the window from opening in the
first place. Once it's opened you would have to use FindWindow() or some
other Win32 API calls to get the window handle for the Reminders window and
then send it a WM_CLOSE message, again using Win32 API calls.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
Hi All,

I cannot find the way that close reminder window programatically.

I found dismiss method here.
http://msdn2.microsoft.com/en-us/library/bb176766.aspx
But I cannot find close method...

basically, I want these,
1 call sql query at once reminder fire - done
2 change the label of item - done
3 close reminder window

Please, advice me!

Thanks,
soworl



  #4  
Old February 4th 08, 06:50 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,404
Default close reminder window programatically

The Application.Reminder() event can't be cancelled, so it's good for
telling you that a reminder has fired only, not for preventing the Reminders
window from appearing. For that you want to use the Application.Reminders
collection and to handle the BeforeReminderShow(Cancel As Boolean) event. If
Cancel is set to True in that event the window won't open. Then you can
handle the Reminders.ReminderFire() event to see what reminder is firing or
use the Application.Reminder event to see that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
Thanks Ken,

Can you give me a useful link for intercept the event & prevent open
reminder window?

for your info, Here is my code
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first
parameter=milliseconds
' I'll add sql query here
SetApptColorLabel Item, 5
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''

Thanks,
soworl


  #5  
Old February 4th 08, 08:04 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default close reminder window programatically

thanks for your help.

I modified my source for test, but it's not working.
I cannot see the msg box, "Do you want to view the reminder"

do you know what's wrong?

Thanks,
soworl
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application
Dim WithEvents colReminders As Reminders

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
Set colReminders = myolapp.Reminders
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first parameter=milliseconds
SetApptColorLabel Item, 5
End Sub

Private Sub colReminders_BeforeReminderShow(Cancel As Boolean)
Dim lngAns As Long

lngAns = MsgBox("Do you want to view the reminder?", vbYesNo)
If lngAns = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''

"Ken Slovak - [MVP - Outlook]" wrote:

The Application.Reminder() event can't be cancelled, so it's good for
telling you that a reminder has fired only, not for preventing the Reminders
window from appearing. For that you want to use the Application.Reminders
collection and to handle the BeforeReminderShow(Cancel As Boolean) event. If
Cancel is set to True in that event the window won't open. Then you can
handle the Reminders.ReminderFire() event to see what reminder is firing or
use the Application.Reminder event to see that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
Thanks Ken,

Can you give me a useful link for intercept the event & prevent open
reminder window?

for your info, Here is my code
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first
parameter=milliseconds
' I'll add sql query here
SetApptColorLabel Item, 5
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''

Thanks,
soworl



  #6  
Old February 4th 08, 08:46 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,404
Default close reminder window programatically

Are any macros working? What happens if you put the cursor in
Application_Startup() and press F5, does the code run and then initialize
the event handlers?

The code is in ThisOutlookSession?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
thanks for your help.

I modified my source for test, but it's not working.
I cannot see the msg box, "Do you want to view the reminder"

do you know what's wrong?

Thanks,
soworl
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application
Dim WithEvents colReminders As Reminders

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
Set colReminders = myolapp.Reminders
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first
parameter=milliseconds
SetApptColorLabel Item, 5
End Sub

Private Sub colReminders_BeforeReminderShow(Cancel As Boolean)
Dim lngAns As Long

lngAns = MsgBox("Do you want to view the reminder?", vbYesNo)
If lngAns = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''


  #7  
Old February 4th 08, 10:23 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default close reminder window programatically

so rear..

the code is in thisOutlookSession.
it used to call myolapp_Reminder, but not now.


"Ken Slovak - [MVP - Outlook]" wrote:

Are any macros working? What happens if you put the cursor in
Application_Startup() and press F5, does the code run and then initialize
the event handlers?

The code is in ThisOutlookSession?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
thanks for your help.

I modified my source for test, but it's not working.
I cannot see the msg box, "Do you want to view the reminder"

do you know what's wrong?

Thanks,
soworl
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''
Dim WithEvents myolapp As Outlook.Application
Dim WithEvents colReminders As Reminders

Private Sub Application_Startup()
Initialize_handler
End Sub

Sub Initialize_handler()
Set myolapp = Outlook.Application
Set colReminders = myolapp.Reminders
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
Interval = DateDiff("s", Now(), Item.End) 'seconds
EnableTimer Interval * 1000, Me 'first
parameter=milliseconds
SetApptColorLabel Item, 5
End Sub

Private Sub colReminders_BeforeReminderShow(Cancel As Boolean)
Dim lngAns As Long

lngAns = MsgBox("Do you want to view the reminder?", vbYesNo)
If lngAns = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''



  #8  
Old February 5th 08, 02:55 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,404
Default close reminder window programatically

Are any macros working?

What happens if you put the cursor in Application_Startup() and press F5,
does the code run and then initialize the event handlers?

What are your macro security settings (Tools, Macros, Security)?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
so rear..

the code is in thisOutlookSession.
it used to call myolapp_Reminder, but not now.


  #9  
Old February 5th 08, 03:35 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default close reminder window programatically

security settings : medium

What happens if you put the cursor in Application_Startup() and press F5,

- nothing T.T

when i run the outlook, it asks whether enable macro or not.
I click enable macro.


"Ken Slovak - [MVP - Outlook]" wrote:

Are any macros working?

What happens if you put the cursor in Application_Startup() and press F5,
does the code run and then initialize the event handlers?

What are your macro security settings (Tools, Macros, Security)?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
so rear..

the code is in thisOutlookSession.
it used to call myolapp_Reminder, but not now.



  #10  
Old February 5th 08, 04:03 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,404
Default close reminder window programatically

Show the exact code you're currently using.

So if you press F5 in that Application_Startup() code it runs and without
any errors?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"soworl" wrote in message
...
security settings : medium

What happens if you put the cursor in Application_Startup() and press F5,

- nothing T.T

when i run the outlook, it asks whether enable macro or not.
I click enable macro.


 




Thread Tools
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 set the follow up reminder time programatically? Levarish Outlook and VBA 1 November 26th 07 06:47 AM
Update Outlook reminder dialog programatically j Add-ins for Outlook 7 February 19th 07 10:38 PM
Refresh Outlook's reminder dialog programatically j Add-ins for Outlook 0 February 15th 07 01:32 PM
How to suppress Reminder dialog box programatically UB Outlook - General Queries 0 December 11th 06 10:56 AM
Window Won't Close Jan Groshan Outlook - General Queries 2 June 23rd 06 03:21 PM


All times are GMT +1. The time now is 04:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Free Advertising - Web directory - Mortgage Calculator - Mortgage Calculator - Play Sport