shieldsco
asked on
Outlook 2010 default message on shared calendar
I have a shared outlook 2010 calendar that I would like to have a default message in the body when anybody schedules a new appointment. Any thoughts...Thanks
ASKER
Any other thoughts......
ASKER
What would the macro look like
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works good but how do I change the code to a shared calendar named Conference Call
ASKER
Its in the folder Conference Call
Is that another calendar in your profile, a calendar in another mailbox, or a calendar in a public folder?
ASKER
In my profile
If this is a sub-calendar under your main calendar, then change this line
Set olkCal = Session.GetDefaultFolder(o lFolderCal endar).Ite ms
to
Set olkCal = Session.GetDefaultFolder(o lFolderCal endar).Fol ders("Conf erence Call").Items
Also, since the calendar is in your profile, you'll only want the code on one computer. But, this also introduces a couple of problems. If the code is on multiple computers and those computers are all on when an item is added, then each would add the text to the item. On the other hand, if the computer with the code isn't on when someone adds an item, then the text won't get added to the body at all.
Set olkCal = Session.GetDefaultFolder(o
to
Set olkCal = Session.GetDefaultFolder(o
Also, since the calendar is in your profile, you'll only want the code on one computer. But, this also introduces a couple of problems. If the code is on multiple computers and those computers are all on when an item is added, then each would add the text to the item. On the other hand, if the computer with the code isn't on when someone adds an item, then the text won't get added to the body at all.
ASKER
How can I also put the message on both my default and shared calendar
Set olkCal = Session.GetDefaultFolder(o lFolderCal endar).Ite ms and Set olkCal = Session.GetDefaultFolder(o lFolderCal endar).Fol ders("Conf erence Call").Items
Set olkCal = Session.GetDefaultFolder(o
This will monitor both calendars, inserting text into any appointment/meeting added to either one.
Dim WithEvents olkCal1 As Outlook.Items
Dim WithEvents olkCal2 As Outlook.Items
Private Sub Application_Quit()
Set olkCal1 = Nothing
Set olkCal2 = Nothing
End Sub
Private Sub Application_Startup()
Set olkCal1 = Session.GetDefaultFolder(olFolderCalendar).Items
Set olkCal2 = Session.GetDefaultFolder(olFolderCalendar).Folders("Conference Call").Items
End Sub
Private Sub olkCal1_ItemAdd(ByVal Item As Object)
InsertText Item
End Sub
Private Sub olkCal2_ItemAdd(ByVal Item As Object)
InsertText Item
End Sub
Sub InsertText(Item As Object)
'On the next line replace "Your text goes here" with the text you want to insert in each appointment
Item.Body = "Your text goes here."
Item.Save
End Sub
ASKER
One last question ... how would I change to a public folder... Thanks
To open a calendar in a public folder use something like this
Set olkCal = Session.GetDefaultFolder(o lPublicFol dersAllPub licFolders ).Folders( "Your Folder Name")
Set olkCal = Session.GetDefaultFolder(o
ASKER
Thanks ... Great Job
You're welcome!
If you can publish a form to your Exchange server's organizational forms library, then you should be able to do this with a custom form. If that's not possible, then the only solution I can think of is to use a macro. That macro would have to be installed on every computer that would ever create an item on the shared calendar.