|
![]() |
|
|
|
|
| VISUAL BASIC CODE (Milestones interface calls shown in Blue) | |
|
Sub Main()
Dim objproject, objmilestones, tasks, T As Object 'Create the Milestones object 'Create the MS Project object 'Create the tasks object 'Start Milestones 'Set Schedule start and end dates 'Format the schedule 'first, make sure there are no columns 'set up one column on the left side of
the schedule
'make it left-justified 'add a column heading
'we will have 22 tasks on each page 'add a curtain to shade the first 15
days of January 'Add titles using information in MS
Project file 'set up the symbology for summary tasks 'set up the symbology for non-summary
tasks 'set up symbology for critical tasks 'set up symbology for one-day events
(milestones) 'set up the legend 'loop through the list of MS Project
tasks and build For Each T In tasks objmilestones.settasklinegrid
currentrow, 0, 7, 0 objmilestones.settasklinegrid
currentrow, 1, 7, 1 If T.Summary = True Then If T.Critical = True Then 'add text to the task name column If Format(T.Start, "MM/DD/YY") =
Format(T.Finish, "MM/DD/YY") Then 'single day milestones Else 'add start+finish dates If T.Critical = True Then 'color critical symbols red 'shade the critical tasks End If End If 'set the outline level 'set the font size 'display a message in the status bar 'keep the schedule open 'Maximize the Milestones window Exit Sub End Sub |
| 1 | Create a new VB Project and copy the above code into your project. | |
| 2 | Change the MPP file reference to reference one of your MS Project files. | |
| 3 | Run the Program. |
Click here to visit our main programmer's page.
