Article ID: 281111 - Last Review: August 8, 2007 - Revision: 1.3 OL97: How to Create a Solution That Runs at a Specific Time IntervalThis article was previously published under Q281111 On This PageSUMMARY
Microsoft Outlook does not provide built-in functionality that allows you to send mail or perform some other custom task at a specific time interval. However, as a developer, you can create this type of solution by using various developer technologies and operating system features. This article provides an overview of how you can begin to implement this type of solution.
MORE INFORMATIONIMPORTANT: This article describes how to create an Outlook solution to be used on a typical end-user computer. It does not take into account possible server-based solutions. For example, if you are using Microsoft Exchange Server 5.5 Service Pack 1 (SP1) or later, there is an OnTimer event that you can associate with a server-based folder. For more information on implementing this event, see the following Microsoft Web site:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/exchserv/events_6a5v.htm
(http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/exchserv/events_6a5v.htm)
Outlook does not have what is commonly called a "timer" event. These events typically have the ability to run at a specified time interval, such as every 15 minutes, or once a day.However, there are a variety of ways to create a custom solution that implements this functionality. The design of the solution depends on the many factors, including:
Develop the Task to Be RepeatedFirst, you must determine how to use the Outlook object model to perform the custom operation once. It is often useful to use Outlook Visual Basic for Applications to prototype this part of the solution. You can later move this code to another development environment after it is functioning correctly. For example, if you want to send a custom mail message once a day, you can adapt the routine to programmatically send a mail message from an example available in the following Microsoft Knowledge Base article:209948
(http://support.microsoft.com/kb/209948/EN-US/
)
ACC2000: How to Use Automation to Send a Microsoft Outlook Message
Determine What Will Run the Code RepeatedlyMicrosoft Windows 9x-based ComputersIf you are using a Windows 9x-based operating system, you can use the Windows Task Scheduler to run any executable file at a specific time interval. This executable can be a compiled application that was created by using a COM-compliant development environment, such as Microsoft Visual Basic, or you can use a Visual Basic Script file (.vbs) if you have Windows Script Host installed on the computer. For additional information on Windows Script Host, see the following Microsoft Web site:http://msdn2.microsoft.com/en-us/library/ms950396.aspx
(http://msdn2.microsoft.com/en-us/library/ms950396.aspx)
Microsoft Windows NT or Microsoft Windows 2000 ComputersIf you are using Windows NT or Windows 2000, the Task Scheduler runs in a service. You cannot automate the Outlook object model from a service, or a process that is spawned from a service. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:237913
(http://support.microsoft.com/kb/237913/EN-US/
)
INFO: Outlook Object Model Unsuitable to Run in a Windows Service
Important considerations:
REFERENCESFor additional information about creating solutions with Microsoft Outlook, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
166368
(http://support.microsoft.com/kb/166368/EN-US/
)
OL97: Resources for Custom Forms and Programming
170783
(http://support.microsoft.com/kb/170783/EN-US/
)
OL97: Q&A: Questions About Customizing or Programming Outlook
| Article Translations
|

Back to the top
