cacomputerguy
asked on
Changing Outlook Calendar Appointment Subject from VB Code
I have the following code:
Dim app As New Outlook.Application
Dim ns As NameSpace
Dim Calendar As MAPIFolder
Dim Item As Object
Set ns = app.GetNamespace("MAPI")
Set Calendar = ns.GetDefaultFolder(olFold erCalendar )
For Each Item In Calendar.Items
Item.Subject = "*" + Item.Subject
DoEvents
Next Item
From the Watch window I can see that it changes the item.subject field but it doesn't save it back to the appointment. How do I get it to permanently update the Appointment's Subject?
Dim app As New Outlook.Application
Dim ns As NameSpace
Dim Calendar As MAPIFolder
Dim Item As Object
Set ns = app.GetNamespace("MAPI")
Set Calendar = ns.GetDefaultFolder(olFold
For Each Item In Calendar.Items
Item.Subject = "*" + Item.Subject
DoEvents
Next Item
From the Watch window I can see that it changes the item.subject field but it doesn't save it back to the appointment. How do I get it to permanently update the Appointment's Subject?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This depends on the version. In Outlook 2007 and 2010, colors can be associated with categories, so all you need to do it set the category (field name: Categories) to a specific value, and then the appointment label will have that color. For earlier versions, I don't think this is possible.
Here is the Color Categories dialog
Color-Categories.jpg
Color-Categories.jpg
ASKER