Link to home
Start Free TrialLog in
Avatar of shieldsco
shieldscoFlag for United States of America

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
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, shieldsco.

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.
Avatar of shieldsco

ASKER

Any other thoughts......
What would the macro look like
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works good but how do I change the code to a shared calendar named Conference Call
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?
In my profile
If this is a sub-calendar under your main calendar, then change this line

Set olkCal = Session.GetDefaultFolder(olFolderCalendar).Items

to

Set olkCal = Session.GetDefaultFolder(olFolderCalendar).Folders("Conference 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.
How can I also put the message on both my default and shared calendar
Set olkCal = Session.GetDefaultFolder(olFolderCalendar).Items and Set olkCal = Session.GetDefaultFolder(olFolderCalendar).Folders("Conference Call").Items
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

Open in new window

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(olPublicFoldersAllPublicFolders).Folders("Your Folder Name")
Thanks ... Great Job
You're welcome!