' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ' Copyright (c) 2006 James P. MacLennan All Rights Reserved ' Questions? Comments? Suggestions? Let me know ... www.cazh1.com ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Sub NicePrintPage_Gantt() ' Standard format of printout page - looks nice and clean ' Used with specific Gantt views ' 03/20/2006 jpm Dim sText As String If ActiveProject.Views(ActiveProject.CurrentView).Type <> pjTaskItem Then MsgBox "This routine only works when looking at a Task view", vbCritical + vbOKOnly, "Error" Exit Sub End If ' Lock in the column widths etc. on the standard View and Table, and then apply TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, Create:=True, OverwriteExisting:=True, FieldName:="ID", Title:="", Width:=6, Align:=1, ShowInMenu:=True, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Indicators", Title:="", Width:=6, Align:=0, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Text1", Title:="PRS#", Width:=6, Align:=1, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Name", Title:="Task Name", Width:=55, Align:=0, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=0 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="% Complete", Title:="", Width:=8, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Start", Title:="", Width:=8, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Finish", Title:="", Width:=8, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Deadline", Title:="", Width:=8, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Duration", Title:="", Width:=8, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableEdit Name:="_JPM Roadmap Gantt", TaskTable:=True, NewFieldName:="Predecessors", Title:="", Width:=10, Align:=2, LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, AlignTitle:=1 TableApply Name:="_JPM Roadmap Gantt" ViewApply Name:="_JPM Roadmap Gantt" ' Landscape gives a bit of room for the gantt chart. ' Should keep to 100% (no scaling) unless you add too many columns ' 11x17 (tabloid) size is nice cuz you can fold it in half to 8.5x11 FilePageSetupPage Portrait:=False, PercentScale:=100, PaperSize:=pjPaperTabloid ' Standard header / footer text sText = "&" & Chr(34) & "Arial" & Chr(34) ' font FilePageSetupHeader Alignment:=pjLeft, Text:=sText & "&08Project: &10&B&[Project Title]&B" & Chr(10) & "&08View: &09&[View]" FilePageSetupHeader Alignment:=pjCenter, Text:=" " sText = "&" & Chr(34) & "Arial" & Chr(34) ' font sText = sText & "&08" ' size FilePageSetupHeader Alignment:=pjRight, Text:=sText & "Last Update: &[Saved Date]" FilePageSetupFooter Text:="" FilePageSetupFooter Alignment:=pjLeft, Text:="&[File Name and Path]" & Chr(10) & "Proprietary and Confidential, My Company Name" FilePageSetupFooter Alignment:=pjCenter, Text:=" " FilePageSetupFooter Alignment:=pjRight, Text:=sText & "Page &[Page] of &[Pages]" ' Nice margins to max out paper use ' who needs a legend? FilePageSetupMargins Top:=0.3, Right:=0.3, Bottom:=0.3, Left:=0.5 ' Left is a bit bigger, for the hole punches FilePageSetupLegend LegendOn:=0 ' Set the timescale TimescaleEdit TopUnits:=pjTimescaleYears, TopLabel:=pjYear_yyyy, TopCount:=1, TierCount:=3 TimescaleEdit MajorUnits:=pjTimescaleQuarters, MajorUseFY:=True, MajorLabel:=pjQuarter_Qq, MajorTicks:=True TimescaleEdit MinorUnits:=pjTimescaleMonths, MinorUseFY:=True, MinorLabel:=pjMonth_mmm, MinorTicks:=True TimescaleEdit Separator:=True ' Leave 'em at the Preview FilePrintPreview End Sub