| | Awarded by Microsoft since 2005: |  |
| | VBOffice Info | | Visitors | 1388809 | | Impressions | 5086607 |
| |
|
| |
| Author: Michael Bauer | Homepage | | Date: 19.01.2006 | Accessed: 40689 | | | | Description
Do you have to send an email every day at the same time? You can use a Reminder to achieve that.
Create a TaskItem with a unique subject and determine the reminder time. Please see the DateAdd function in the sample: DateAdd("d", 1, oTask.ReminderTime) adds one day to the current reminder time. For a list of what parameter are possible, please set the cursor on to the function name (DateAdd) and press F1 for the VBA help. |
Private Const REMINDER_SUBJECT As String = "DailyMailReminder"
Private Sub Application_Reminder(ByVal Item As Object)
SendMailInReminderIntervals Item
End Sub
Private Sub SendMailInReminderIntervals(Item As Object)
Dim oTask As Outlook.TaskItem
Dim oMail As Outlook.MailItem
Dim oFld As Outlook.MAPIFolder
Const TEMPLATE_SUBJECT As String = "Daily Mail"
Const TEMPLATE_ADR As String = "abc@domain.com"
Const TEMPLATE_BODY As String = "Hello"
If TypeOf Item Is Outlook.TaskItem Then
Set oTask = Item
If oTask.SUBJECT = REMINDER_SUBJECT Then
oTask.ReminderTime = DateAdd("d", 1, oTask.ReminderTime)
oTask.Save
Set oMail = Application.CreateItem(olMailItem)
oMail.SUBJECT = TEMPLATE_SUBJECT
oMail.Body = TEMPLATE_BODY
oMail.Recipients.Add TEMPLATE_ADR
oMail.Recipients.ResolveAll
oMail.Send
End If
End If
End Sub
|
| | |
| | |  | ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more] |
| | |  | Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more] |
| | |  | SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more] |
| | |  | OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more] |
| |
|