Solved

Outlook 2010 default message on shared calendar

Posted on 2014-10-28
15
275 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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

762 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

20 Experts available now in Live!

Get 1:1 Help Now