Solved

Outlook 2010 default message on shared calendar

Posted on 2014-10-28
15
280 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
 
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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: …

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now