You can receive Item_PropertyChange only if you have an object variable set
to that item.
But as I understand you know you won't receive any events.
Item_PropertyChange or ItemChange fire if a property of an item has been
changed. In your case not an item property changes but the system time.
So, what you have to do is write a code that runs once a day and checks all
the tasks in the folder. If an overdue item is found send the e-mail. If you
want to avoid sending multiple e-mails for the same task you can add a
userdefined field to the item and store a flag that the e-mails has been
sent already.
This sample demonstrates how you can send an e-mail every day at the same
time. You can use it to run your code instead:
http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=10&cmd=showitem
Of course, Outlook must be running to execute the code.
Best regards
Michael Bauer - MVP Outlook
: Outlook Categories? Category Manager Is Your Tool:
: <http://www.vboffice.net/product.html?pub=6&lang=en>
Am Wed, 7 May 2008 00:14:24 +0800 schrieb Shen:
> Yes, I already add the Send code inside. the following is the code:
>
> Sub Item_PropertyChange(ByVal Name)
> Select Case Name
> Case "Status"
> if Item.Status = 2 then '2 = Completed
> Set NewItem = Application.CreateItem(0)
> NewItem.To = "myemailaddress@myisp.com"
> NewItem.Recipients.ResolveAll
> NewItem.Subject = "This is the message subject text"
> NewItem.Body = "This is text that will appear in the
body
> of the message."
> NewItem.Send
> End IF
> End Select
> End Sub
>
> Then I create the task, and send DueDate, ReminderTimer and the Recurring
> rule. when the task is overdue,
> the color of the task in tasklist is changed to red, but don't trigger
the
> above envent. It means that outlook dosen't
> call Item_PropertyChange(ByVal Name) when task's overdue. but I want do
> "Send mail automatic" when the task's overdue.
> so how should i do?
>
>
>
> "Michael Bauer [MVP - Outlook]" <mb@mvps.org>
> ??????:1ankaquxrw67t$.bnf8votl40lf$.dlg@40tude.net...
>>
>>
>> The sample doesn't send but display the e-mail. If you want it to be sent
>> don't call the Display but Send method.
>>
>> --
>> Best regards
>> Michael Bauer - MVP Outlook
>>
>> : Outlook Categories? Category Manager Is Your Tool:
>> : <http://www.vboffice.net/product.html?pub=6&lang=en>
>>
>>
>> Am Tue, 6 May 2008 10:06:49 +0800 schrieb Shen:
>>
>>> Dear all,
>>>
>>> I'm a novice about outlook programmmer. Now,there is a problem when I
>>> write the code for atuomatic sending the email.
>>>
>>> according the article from the microsoft:
>>>
http://support.microsoft.com/kb/239087/en-us/ I created the task, but
>> when
>>> I receive the reminder that the task is due, It can't send the mail
>>> automatic, I should give the "Complete" flag to trigger the
>>> Item_PropetyChange() event.But I want it complete automatic sending the
>>> mail. How can I do?
>>>
>>> I think I should add a another event about the task overdue, but I
>> don't
>>> know how to do? pls help!
>>>
>>> Thanks!
>>>
>>> Sam