Last reviewed on June 14, 2015   —  43 Comments

I'm often asked if there is a way within Outlook to print a single calendar containing the appointments from every calendar in the profile. Although Outlook doesn't have this ability built in, you could copy all of the appointments to one calendar and print, or use the Calendar Printing Assistant or third party print utilities.

Note: The calendars need to be in your profile as mailboxes, not opened as shared calendars. This will not work with shared calendars that display only Free/Busy.

Copying appointments from list view is fairly easy, if monotonous, but a macro makes quick work of it. This question on Outlook forums finally nudged me to write a macro that would do it: combine 24 meeting room calendars in to 1 single list.

The result is a set of macros pulled from macros previously published here at Slipstick. (Not a lot of writing involved!)

The macros that I tweaked to copy the appointments from the selected calendars were originally published at Select multiple calendars in Outlook and Copy Recurring Appointment Series to Appointments.

The macro deletes the calendar called Print, if it exists, then creates a new calendar folder named Print , then checks to see if one or more calendars are selected in the navigation pane, and if so, it copies the appointments to the Print calendar.

My sample copies appointments for the next 3 days, but you can add (or subtract) from Date to include any period. The data file name (as seen in the folder list) is added to each appointment as a category, so you know which calendar each appointment is from (I use category colors that match the calendar color). Recurring appointments are copied to the Print calendar as single appointments.

Create a Print Calendar

After running the macro, go into File, Print, click Print Options and select the Print calendar then click Print.

Note: this code was updated on July 15 2014 to create the Print calendar automatically. If the print calendar exists, it deletes it and recreates it, otherwise it creates it. It was updated on July 29 2014 to check each group for selected calendars.

Calendars in Exchange Public folders are categorized using "Favorites", not their actual folder name. You can include the calendar name when creating the category: calName = CalFolder.Parent.Name & "-" & CalFolder.Name

To use the macro, paste it into the VBA Editor then click in PrintCalendarsAsOne macro and click Run (F5). If you want to run it using a button on the ribbon or QAT, select the PrintCalendarsAsOne macro and add it to the ribbon or QAT.

   Dim CalFolder As Outlook.Folder
   Dim printCal As Outlook.Folder
    
' Run this macro 
Sub PrintCalendarsAsOne()
    Dim objPane As Outlook.NavigationPane
    Dim objModule As Outlook.CalendarModule
    Dim objGroup As Outlook.NavigationGroup
    Dim objNavFolder As Outlook.NavigationFolder
    Dim objCalendar As Folder
    Dim objFolder As Folder
      
    Dim i As Integer
    Dim g As Integer
     
    On Error Resume Next
    
    Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
    Set printCal = objCalendar.Folders("Print")
    printCal.Delete
    Set printCal = objCalendar.Folders.Add("Print")
      
    Set Application.ActiveExplorer.CurrentFolder = objCalendar
    DoEvents
      
    Set objPane = Application.ActiveExplorer.NavigationPane
    Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
      
  With objModule.NavigationGroups
    
    For g = 1 To .count

    Set objGroup = .Item(g)
   
    For i = 1 To objGroup.NavigationFolders.count
        Set objNavFolder = objGroup.NavigationFolders.Item(i)
     If objNavFolder.IsSelected = True Then
     
   'run macro to copy appt
        Set CalFolder = objNavFolder.folder
        CopyAppttoPrint
    
    End If
    Next i
    Next g
    End With
  
  
    Set objPane = Nothing
    Set objModule = Nothing
    Set objGroup = Nothing
    Set objNavFolder = Nothing
    Set objCalendar = Nothing
    Set objFolder = Nothing
End Sub
 
 
Private Sub CopyAppttoPrint()
     
   Dim calItems As Outlook.Items
   Dim ResItems As Outlook.Items
   Dim sFilter As String
   Dim iNumRestricted As Integer
   Dim itm, newAppt As Object
 
   Set calItems = CalFolder.Items
    
   If CalFolder = printCal Then
     Exit Sub
   End If
    
' Sort all of the appointments based on the start time
   calItems.Sort "[Start]"
   calItems.IncludeRecurrences = True
 
  calName = CalFolder.Parent.Name
' to use category named for account & calendar name 
' calName = CalFolder.Parent.Name & "-" & CalFolder.Name
     
'create the filter - this copies appointments today to 3 days from now
   sFilter = "[Start] >= '" & Date & "'" & " And [Start] < '" & Date + 3 & "'"
  
   ' Apply the filter
   Set ResItems = calItems.Restrict(sFilter)
  
   iNumRestricted = 0
  
   'Loop through the items in the collection.
   For Each itm In ResItems
      iNumRestricted = iNumRestricted + 1
        
Set newAppt = itm.Copy
newAppt.Categories = calName

newAppt.Move printCal

   Next
   ' Display the actual number of appointments created
    Debug.Print calName & " " & (iNumRestricted & " appointments were created")
  
   Set itm = Nothing
   Set newAppt = Nothing
   Set ResItems = Nothing
   Set calItems = Nothing
   Set CalFolder = Nothing
    
End Sub
 
 

How to use macros

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor


Comments

  1. Pete Maryan says

    I'm trying to use this macro in Outlook 2013 32bit, for the exact purpose of printing out a calendar derived from all rooms in a location.

    I've copied the code above into a Module, but it keeps failing to run successfully. I've created a new calendar called Print and I've selected my room calendars.

    When I run the macro for PrintCalendarsAsOne it breaks at: Set printCal = Session.GetDefaultFolder(olFolderCalendar).Folders("Print")

    When I run DeleteApponPrint it breaks at: Set calItems = printCal.Items

    Any suggestions?

    • Diane Poremsky says

      The Print calendar is located under the Default calendar? What does the error say when it hits that folder?

    • Diane Poremsky says

      As an FYI, i updated the macro to create the Print calendar automatically.

    • Diane Poremsky says

      As long as the calendars are in your profile and are selected, it should work. Oh, are they in a different group? It uses the default group. I'll add a loop to check a second group.

    • Diane Poremsky says

      Replace the original block with this (between Set objModule and all of the set = Nothing's) - I'll update the code to use it.
      Dim g As Integer
      With objModule.NavigationGroups

      For g = 1 To .count
      Debug.Print g

      Set objGroup = .Item(g)

      For i = 1 To objGroup.NavigationFolders.count
      Set objNavFolder = objGroup.NavigationFolders.Item(i)
      If objNavFolder.IsSelected = True Then

      'run macro to copy appt
      Set CalFolder = objNavFolder.folder
      CopyAppttoPrint

      End If
      Next i
      Next g
      End With

    • Jim says

      Thanks Diane.

      It's still not working for me. My other calendars are in a "Shared Calendars" group.

      I can take a screen shot and send it to you if you think that might help.

    • Diane Poremsky says

      do you get any error messages? Are any appointments copied to the new calendar?

    • Pomeranian Club Central VA says

      I am experiencing the same problem as Jim. I get the End/Debug error when it gets to here: Sub PrintCalendarsAsOne()

  2. Tereese says

    Hi Diane. Thank you so much for this code!! One question though, how do you use the category colors that match the calendar color? The categories in my print calender are all one color.

    • Diane Poremsky says

      I assigned the colors to the categories. I don't know if its possible to grab the color from the calendar but will check. If i can the macro can add the category to the master list.

    • Tereese says

      Thanks. I have several shared calenders as mailboxes under my default calender profile and I only want those calenders pulled to the print calender. I select the calenders that I want, but when I run the macro it always pulls in my default calender even though I don't have it selected. How do I only pull the calenders I selected? I tried adding the case statement from the "Select multiple calendars in Outlook" but it's not pulling correctly.

    • Diane Poremsky says

      I'll check the code and make sure it's not picking it up automatically. (It is picking up the default calendar but I'm not sure why. yet.)

    • Diane Poremsky says

      Ok... try removing this line after it creates the print calendar. I think the doevents can be deleted to (it basically adds a delay)
      Set Application.ActiveExplorer.CurrentFolder = objCalendar

    • Diane Poremsky says

      The macro looks to see which calendars are selected and displayed and copies appointments from those calendars only.

    • Johne Smith says

      Thanks for the reply. I have multiple selected and it still only copies mine. all of my calendars are under My Calendars for me. They aren't in different groups.

  3. Carlos Novas says

    I am having difficulties running this macro. When I run the macro in VBA I get an error related to the line: Set calItems = CalFolder.Items

    Any help figuring this out would be greatly appreciated

    • Diane Poremsky says

      Without knowing what the error is, it's hard to say, but I'm guessing it is because the CalFolder object is not valid for some reason. It's set in the first macro in this line:
      Set CalFolder = objNavFolder.folder

  4. muffitt says

    I have several sites with events on that i would like to import into a calander where i can see all of the event s together. is this possible

    • Diane Poremsky says

      Yes, it is possible as long as you can get the calendars in a format Outlook can import. (The macro on this page probably won't help you because the calendar needs to be in Outlook.)

    • muffitt says

      so how would i do this, then. there's about 20 sites with horse events on a diary. Each site is a different venue.

      I would like to have them all automatically put on once calandar so i dont have to jump to each site in order to look to see what event i want to attend or what is on

    • Diane Poremsky says

      These are web sites? If they have a calendar you can subscribe to, you can subscribe to it in Outlook, using File, Account Settings, Internet Calendars. Copy the url and paste into the New dialog on the Internet Calendars tab. It won't put them on the same calendar, but you can overlay them in outlook.

    • Diane Poremsky says

      Are they in mailboxes opened in your profile or in shared mailboxes where only the calendar is open in your profile? I haven't been able to make it work when only the calendar is shared - the mailbox needs to be open in the profile (either as an account or as a secondary mailbox to your account).

  5. Scott Beecher says

    Love the macro! Is it possible to keep the color formats of the original calendars when they are copied over to the new PRINT calendar?

    • Diane Poremsky says

      Category colors or the calendar tab color? You can use the appointment categories by changing this line:
      .Categories = calName '& ";" & itm.Categories
      to
      .Categories = itm.Categories
      or
      .Categories = itm.Categories '& ";" & calName

    • Dan T. says

      Thanks for this tool, Diane. It's working as intended, but I still don't see the .Categories = calName (...) to replace as you mentioned.
      Am I missing something?

  6. mrsadmin says

    Hi Diane, I love this macro, makes my juggling a lot easier.
    I'm having the same problem as Scott Beecher, the code works great, but I can't see where to put the new code in for the category colours to use the calName.

    I've copied exactly as you wrote the macro, I haven't edited, I just can't figure out where to add in the new snippet.

    Cheers,

    • Diane PoremskyDiane Poremsky says

      Hmm. I don't see it either... in CopyAppttoPrint macro, add the categories after the copy is created and before it's moved. (I updated the code to make it more efficient and didn't add the category back.)

      Set newAppt = itm.Copy
      newAppt.Categories = calName
      newAppt.Move printCal

      if you want to keep categories that existed before, use
      newAppt.Categories = calName & "," & newAppt.Categories
      or
      newAppt.Categories = newAppt.Categories & "," & newAppt.Categories

  7. Jennifer says

    Hi Diane -
    I'm getting the same error as Carlos above... re: "Set calItems - CalFolder.Items"

    My VB error says:
    Run-time error '91':

    Object variable or With block variable not set

    I do have exchange 365 if that makes a difference for anything.

    Thank you,
    Jennifer

    -------------------------------------------------------------------------------------------

    • Diane PoremskyDiane Poremsky says

      What types of calendars are selected? If the calendar is a shared calendar, I don't think the code works (but I'll need to test it again to refresh my memory :)).

    • Tony Lopez says

      Hi, I am getting this same error message and cannot seem get the macro to run properly. The calendars I have are not shared calendars as I saw that having them with this macro might cause problems. Any help would be appreciated. Thanks

    • Diane PoremskyDiane Poremsky says

      Are you clicking in the PrintCalendarsAsOne before running the macro? The CopyToPrint macro is a "helper macro" and can't be run from the editor - it's called by PrintCalendarsAsOne macro.

      If that is not the problem, show the Debug Toolbar and Step into the macro so you can see where it errors.
      Right click on the Toolbar area and choose Debug. Click in the PrintCalendarsAsOne macro then click the Step into button. (F8 is the Step into shortcut key.)

  8. Bernd Hohenester says

    Hello Diane, i tried the macro using Outlook 2013 on Win 8.1. It throws no errors, the print-calendar is created but no items are filled in. How may i send you a screen shot of my calendars?
    Thanks a lot for helping me.
    Sincerely
    Bernd

    • Diane PoremskyDiane Poremsky says

      Upload it to onedrive, dropbox etc and post a link here.

      Do you have appt on the calendars due within the time period? The code only copies the next 3 days:
      sFilter = "[Start] >= '" & Date & "'" & " And [Start] < '" & Date + 3

  9. Rhonna says

    Grrr. For Step 2. "Copy and paste the macro into the new module."
    Does the macro code start at
    1. "Dim CalFolder As Outlook.Folder
    2. "Sub PrintCalendarsAsOne()"
    or are we supposed to include the Yellowbox information?
    "... calName = CalFolder.Parent.Name & "-" & CalFolder.Name"

    Sorry to be so naive, but for average user just trying to print multiple calendars for Outlook 2013 this is HUGE learning curve to learn via Visual Basic Editor w/in Excel and know coding for macros.
    Thanks!

Leave a Reply

Please post long or more complicated questions at OutlookForums by Slipstick.com.

If the Post Comment button disappears, press your Tab key.