Solved

Outlook 2010 default message on shared calendar

Posted on 2014-10-28
15
285 Views
Last Modified: 2014-10-30
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
0
Comment
Question by:shieldsco
  • 8
  • 7
15 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 40409843
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.
0
 

Author Comment

by:shieldsco
ID: 40410900
Any other thoughts......
0
 

Author Comment

by:shieldsco
ID: 40411541
What would the macro look like
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 40411622
The code will look like this.  This code must go in the ThisOutlookSession module in Outlook.

This code works by trapping the ItemAdd event that fires each time an item is added to the calendar.  That event fires when the item is saved, not when the item is first created.

Dim WithEvents olkCal As Outlook.Items

Private Sub Application_Quit()
    Set olkCal = Nothing
End Sub

Private Sub Application_Startup()
    'This line will change depending on where the shared calendar is (i.e. public folder versus mail account)
    Set olkCal = Session.GetDefaultFolder(olFolderCalendar).Items
End Sub

Private Sub olkCal_ItemAdd(ByVal 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

0
 

Author Comment

by:shieldsco
ID: 40412092
Works good but how do I change the code to a shared calendar named Conference Call
0
 

Author Comment

by:shieldsco
ID: 40412106
Its in the folder Conference Call
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40412316
Is that another calendar in your profile, a calendar in another mailbox, or a calendar in a public folder?
0
 

Author Comment

by:shieldsco
ID: 40412329
In my profile
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40412413
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.
0
 

Author Comment

by:shieldsco
ID: 40412447
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
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40412847
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

0
 

Author Comment

by:shieldsco
ID: 40413011
One last question ... how would I change to a public folder... Thanks
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40413096
To open a calendar in a public folder use something like this

Set olkCal = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Your Folder Name")
0
 

Author Closing Comment

by:shieldsco
ID: 40413292
Thanks ... Great Job
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40413435
You're welcome!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't know how to downgrade, my instructions below should be helpful.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question