![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hello there,
I am not very good at VBA but with the help of google I found a VBA code which should helped me out but doesnt work... What I want Outlook to do: If I create a new appointment and set it as "private" I want it to automatically set it as colour-categore named "pirvate" and reversed... The VBA-code I found was: Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("MAPI") Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items End Sub Private Sub Items_ItemAdd(ByVal Item As Object) Dim Appt As Outlook.AppointmentItem Dim CategoryName as String CategoryName = "Sample" If TypeOf Item Is Outlook.AppointmentItem Then Set Appt = Item If Appt.Sensitivity = olPrivate Then If Appt.Categories = "" Then Appt.Categories = CategoryName Appt.Save End If ElseIf InStr(1, Appt.Categories, CategoryName, vbTextCompare) Then Appt.Sensitivity = olPrivate Appt.Save End If End If End Sub Can someone help me troubleshoot? Thanks! |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Do you have Private Use Area in your Word - use of private characters | messgchr | Word | 2 | 07-20-2020 08:28 PM |
Outlook 2010 - Color Private appointments | marcc | Outlook | 0 | 03-09-2012 03:21 AM |
Access MD's private appointments in calendar | elinormcl27 | Outlook | 0 | 02-28-2012 04:10 AM |
![]() |
fgiorgio79 | Outlook | 5 | 04-01-2011 04:45 PM |
PA To the CEO Can't Edit Private Appointments Outlook 2007 | Neil Parry | Outlook | 0 | 03-29-2009 10:05 PM |