chrismc
01-29-2006, 04:28 AM
Hi,
I've got some code which allows me to search through my appointments at work and forward the details of certain ones to my home email address. I want to mark the appointments that have already been sent in such a way that they don't get sent next time I run the code. What I thought was that if I use the category field I could achieve this. The following code works fine for checking the category of the appointment (if I've set it manually for testing) and for giving the outgoing message a category. However, it doesn't seem to set the category for the appointment. Can you spot where I'm going wrong please?
Chris
If Appt.Categories <> "Sent" Then
Set myMail = CreateItem(olMailItem)
Set myMail = Appt.ForwardAsVcal
myMail.Recipients.Add AnEmailAddress
myMail.Subject = Appt.Subject & ": " & Appt.Location
myMail.Body = Appt.Location & vbCr & Appt.End
myMail.Categories = "SendNow"
myMail.DeferredDeliveryTime = sendtime
myMail.Send
Appt.Categories = "Sent"
End if
I've got some code which allows me to search through my appointments at work and forward the details of certain ones to my home email address. I want to mark the appointments that have already been sent in such a way that they don't get sent next time I run the code. What I thought was that if I use the category field I could achieve this. The following code works fine for checking the category of the appointment (if I've set it manually for testing) and for giving the outgoing message a category. However, it doesn't seem to set the category for the appointment. Can you spot where I'm going wrong please?
Chris
If Appt.Categories <> "Sent" Then
Set myMail = CreateItem(olMailItem)
Set myMail = Appt.ForwardAsVcal
myMail.Recipients.Add AnEmailAddress
myMail.Subject = Appt.Subject & ": " & Appt.Location
myMail.Body = Appt.Location & vbCr & Appt.End
myMail.Categories = "SendNow"
myMail.DeferredDeliveryTime = sendtime
myMail.Send
Appt.Categories = "Sent"
End if