![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I need a mechanism to enable users to run a macro that will copy all their
appointments of a certain category (e.g., "board meeting") to a shared calendar. or a macro that runs through each users calendar and scans for appointments in that category and copies to a central calendar. |
#2
|
|||
|
|||
![]()
Try the macro below. It'll prompt you to choose the destination Calendar,
and use the default Calendar as the source for items to copy from. Change the "Test" comparison string to look for a Category of your choice. Sub CopyAppointmentsByCategoryToSharedCalendar() Dim objMyCal As Outlook.MAPIFolder, objDestCal As Outlook.MAPIFolder Dim objNS As Outlook.NameSpace Dim objItem As Outlook.AppointmentItem, objNewItem As Outlook.AppointmentItem Set objNS = Application.GetNamespace("MAPI") Set objMyCal = objNS.GetDefaultFolder(olFolderCalendar) 'Get default Calendar folder 'Select Destination Calendar to copy appointments to Set objDestCal = objNS.PickFolder If objDestCal.DefaultItemType olAppointmentItem Then MsgBox "You must choose a Calendar folder.", vbOKOnly + vbExclamation, "Invalid Folder" Exit Sub End If For Each objItem In objMyCal.Items If InStr(objItem.Categories, "Test") 0 Then Set objNewItem = objItem.Copy objNewItem.Move objDestCal End If Next Set objMyCal = Nothing Set objDestCal = Nothing Set objNS = Nothing Set objItem = Nothing Set objNewItem = Nothing End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Gaurav" wrote: I need a mechanism to enable users to run a macro that will copy all their appointments of a certain category (e.g., "board meeting") to a shared calendar. or a macro that runs through each users calendar and scans for appointments in that category and copies to a central calendar. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I select only one category for printing calendar items? | CrabbyOldLady | Outlook - Calandaring | 2 | September 15th 16 08:25 AM |
Copy centain contacts to new folder based on category | Bob Day | Outlook - Using Contacts | 0 | July 24th 06 10:41 PM |
How do I sort my calendar in Category view by subject, then date? | lafngrrl | Outlook - Calandaring | 6 | February 2nd 06 03:10 AM |
Printing a calendar listing by a single category | BigBlueMan | Outlook - Calandaring | 1 | January 18th 06 11:10 PM |
How to email a category of calendar events to another person | SCS Jim Fox | Outlook - Calandaring | 0 | January 18th 06 05:35 PM |