Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Outlook calendar through VBA

Status
Not open for further replies.

ECCOGuy

IS-IT--Management
Aug 31, 2006
33
0
0
US
I'm trying to automate the printing of a weekly list of bookings for a resource. This is what I have so far:
Code:
Sub Print_Cal()
    Dim objFolder As Folder
    Dim objName As NameSpace
    Dim objView As CalendarView
    Dim objExp As Explorer
    Dim objRecipient As Recipient

    Set objName = Application.GetNamespace("MAPI")
    Set objRecipient = objName.CreateRecipient("test_resource")
    objRecipient.Resolve
    
    If Not objRecipient.Resolved Then Exit Sub
    
    Set objFolder = objName.GetSharedDefaultFolder(objRecipient, olFolderCalendar)
    Set objExp = Application.Explorers.Add(objFolder)
    
    Set objView = objExp.CurrentView
    objView.Reset
    objView.CalendarViewMode = olCalendarView5DayWeek '4
    objView.Apply

    '...HELP HERE

    objExp.Close
    Set objView = Nothing
    Set objExp = Nothing
    Set objFolder = Nothing
    Set objRecipient = Nothing
    Set objName = Nothing
End Sub

I just can't figure out how to print the weekly view of the calendar...
I've seen the PrintOut method and it said: 'The PrintOut method is the only Outlook method that can be used for printing.' But it only seems to work for single items, not a calendar? What are my options?

Spencer
MCSE2k, MCSA2k, Net+, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top