jsticca
02-16-2011, 07:45 AM
I have my Outlook 2003 calendar synced with my google calendar via google calendar sync. This program works well except for one instance, if my calender event is a microsoft live meeting the message class class is different than a regular calendar event so it won't sync. I have a macro to convert the live meeting message classes but it will only work if I run it when I am in calendar in Outlook and manually click run. Below is the code:
Sub Calender_Fix()
' Change the following line to your new Message Class
NewMC = "IPM.Appointment"
Set CurFolder = Application.ActiveExplorer.CurrentFolder
Set AllItems = CurFolder.Items
NumItems = CurFolder.Items.Count
' Loop through all of the items in the folder
For i = 1 To NumItems
Set CurItem = AllItems.Item(i)
' Test to see if the Message Class needs to be changed
If CurItem.MessageClass <> NewMC Then
' Change the Message Class
CurItem.MessageClass = NewMC
' Save the changed item
CurItem.Save
End If
Next
End Sub
Ideally, I would have this macro run every time google calendar sync runs (right before). However, if this is too complicated, I would like to set it to run every hour. And if this is too hard, as a last resort, I would like to have it run every time I open/close Outlook.
Any help would be greatly appreciated. Thanks!
Sub Calender_Fix()
' Change the following line to your new Message Class
NewMC = "IPM.Appointment"
Set CurFolder = Application.ActiveExplorer.CurrentFolder
Set AllItems = CurFolder.Items
NumItems = CurFolder.Items.Count
' Loop through all of the items in the folder
For i = 1 To NumItems
Set CurItem = AllItems.Item(i)
' Test to see if the Message Class needs to be changed
If CurItem.MessageClass <> NewMC Then
' Change the Message Class
CurItem.MessageClass = NewMC
' Save the changed item
CurItem.Save
End If
Next
End Sub
Ideally, I would have this macro run every time google calendar sync runs (right before). However, if this is too complicated, I would like to set it to run every hour. And if this is too hard, as a last resort, I would like to have it run every time I open/close Outlook.
Any help would be greatly appreciated. Thanks!