Application.FilePageSetupCalendar method (Project)
Sets up the Calendar for printing.
Syntax
expression. FilePageSetupCalendar
( _Name_
, _MonthsPerPage_
, _WeeksPerPage_
, _ScreenWeekHeight_
, _OnlyDaysInMonth_
, _OnlyWeeksInMonth_
, _MonthPreviews_
, _MonthTitle_
, _AdditionalTasks_
, _GroupAdditionalTasks_
, _PrintNotes_
)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Name | Optional | Variant | Sets up the Calendar for printing. |
MonthsPerPage | Optional | Integer | The number of months to print on each page. Can be 1 or 2. The MonthsPerPage argument is required if OnlyDaysInMonth or OnlyWeeksInMonth is specified. |
WeeksPerPage | Optional | Integer | The number of weeks to print on each page. |
ScreenWeekHeight | Optional | Boolean | True if the week height displayed on screen is used for the printout. |
OnlyDaysInMonth | Optional | Boolean | True if only the days in the month are printed. False if the days at the end of the previous month and at the start of the next month are printed in addition to the days in the current month. The OnlyDaysInMonth argument is ignored unless a value for MonthsPerPage is specified. |
OnlyWeeksInMonth | Optional | Boolean | True if only the weeks that are fully contained in the month are printed. False if weeks that have one or more days in the month are printed. The OnlyWeeksInMonth argument is ignored unless a value for MonthsPerPage is specified. |
MonthPreviews | Optional | Boolean | True if preview calendars for the previous and next months are printed. |
MonthTitle | Optional | Boolean | True if the month's title is printed. |
AdditionalTasks | Optional | Boolean | True if tasks that don't fit on the Calendar are printed. (Additional tasks appear at the end of the printout.) |
GroupAdditionalTasks | Optional | Boolean | True if additional tasks are grouped by day. |
PrintNotes | Optional | Boolean | True if the notes associated with each task are printed. Notes are printed at the end, after any additional tasks |
Return value
Boolean
Remarks
Using the FilePageSetupCalendar method without specifying any arguments displays the Page Setup dialog box with the View tab selected. The FilePageSetupCalendar method is only available when the Calendar is the active view.
Example
The following example sets up the calendar for printing with 2 months per page and with preview calendars for the previous and next months.
Sub File_PageSetupCalendar()
'Activate Calendar view
ViewApply Name:="&Calendar"
FilePageSetupCalendar MonthsPerPage:=2, OnlyDaysInMonth:=False, MonthPreviews:=True
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.