[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Make calendar event private based on category

Posted on 2010-09-16
8
Medium Priority
?
501 Views
Last Modified: 2014-11-12
I sync my google calendar with my corp Outlook account.  All items that sync from my google calender come in with a category of "Family".  I would like to mark these items as private in my Outlook calendar so they can not be seen by those who I share my calendar with.  
0
Comment
Question by:cobianna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 33696636
Hi, cobianna.

Let me start by saying that I've no experience using Outlook with Google calendar.  Depending on how that sync process works it might be possible to do this automatically with a bit of code.  If that doesn't work, then it's possible to do it with a bit of code, but it won't be automatic.  You'll have to run the code manually.  Interested?
0
 

Author Comment

by:cobianna
ID: 33700583
Hi BlueDevilFan!

I'm absolutely interested in the code route.  
0
 

Author Comment

by:cobianna
ID: 33720068
Hi BlueDevil Fan!

I hadn't hear back from you in a while.  Just wanted to check in with you to see if you are still able to help me.
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 76

Expert Comment

by:David Lee
ID: 33742183
Hi, Cobianna.

Sorry to be so slow.  Here's the code.  It comes in two parts.  This is part #1.  

Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  Right-click on Class Modules, select Insert > Class Module
5.  In the Properties panel click on Name and enter FamilyAppts
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Edit the code as needed.  I included comments wherever something needs to or can change
8.  Click the diskette icon on the toolbar to save the changes
9.  Close the VB Editor


Private WithEvents olkFolder As Outlook.Items

Private Sub Class_Initialize()
    Set olkFolder = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items
End Sub

Private Sub Class_Terminate()
    Set olkFolder = Nothing
End Sub

Private Sub olkFolder_ItemAdd(ByVal Item As Object)
    FamilyCheck Item
End Sub

Private Sub olkFolder_ItemChange(ByVal Item As Object)
    FamilyCheck Item
End Sub

Private Sub FamilyCheck(olkItem As Outlook.AppointmentItem)
    Dim arrCats As Variant, varCat As Variant
    arrCats = Split(olkItem.Categories, ",")
    For Each varCat In arrCats
        If LCase(varCat) = "family" Then
            If olkItem.Sensitivity <> olPrivate Then
                olkItem.Sensitivity = olPrivate
                olkItem.Save
            End If
            Exit For
        End If
    Next
End Sub

Open in new window

0
 
LVL 76

Expert Comment

by:David Lee
ID: 33742201
This is part #2.

Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of
5.  Outlook's VB Editor window
6.  Edit the code as needed.  I included comment lines wherever something needs to or can change
7.  Click the diskette icon on the toolbar to save the changes
8.  Close the VB Editor
9.  Click Tools > Macro > Security
10. Set the Security Level to Medium
11. Close Outlook
12. Start Outlook
13. Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

Dim objFamilyAppts As Object

Private Sub Application_Quit()
    Set objFamilyAppts = Nothing
End Sub

Private Sub Application_Startup()
    Set objFamilyAppts = New FamilyAppts
End Sub

Open in new window

0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 33742221
I'm not sure that this code will work with a Google calendar sync and since I don't use Google myself I can't test it.  The approach I've taken here is to watch the calendar for adds and changes.  When one occurs the code checks to see if the added/changed item is a member of the "Family" category.  If it is, then it sets the appointment to "private".  What I don't know is if the Google calendar sync triggers the events raised by a normal item add/change.  If it doesn't, then this won't work and I've no suggestions on how to proceed.
0
 

Author Closing Comment

by:cobianna
ID: 33744955
Thanks for your help.  Worked great.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33745270
You're welcome.  Glad I could help.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

649 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