|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Changes for Custom Project Guides
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
There are relatively few changes from previous versions in the Project Guide for Microsoft Office Project 2007. However, in addition to some new and changed default Project Guide files that are available for templates, your custom Project Guides require changes in the ClassID property for several objects.
You can use the default Project Guide files as templates for creating your own custom Project Guide content. The Project 2007 SDK download includes all of the default Project Guide files and the updated sample Critical Task custom Project Guide. For a link to the download, see Welcome to the Microsoft Office Project 2007 SDK. For more information about developing custom Project Guide panes and custom views, see Project Guide 101 in the Project 2003 SDK.
This article includes the following sections:
Because some object ClassID values have changed, your custom Project Guide solutions that include any of those objects cannot work in Project 2007 until you update the ClassID. Following is an example of how to declare a text converter object in a custom Project Guide.
<object id="TextConv" classid="clsid:0F5E0D2C-54F2-41D9-835F-06B3045B7059" type="application/x-oleobject" style="display: none">TextConv failed to load! </object>
A Microsoft JScript file for a custom Project Guide, such as interview_controls.js in the Project 2003 SDK, can write HTML code for output to the Web browser control as shown in the following example.
document.write("<p>"); document.write("<object id=\""+ ID + "\" name=\"Calendar"+ ID + "\""); document.write(" classid=\"CLSID:A709EC93-E1F9-4bc4-A9CB-7FDB51CD0EF1\""); document.write(" style=\"width: 10em; height: 1.5em;\">"); document.write("</object>") document.write("</p>");
The id value of the object is not important because the id is used only for a reference to the object within the HTML or JScript code. The important part is the ClassID, which is used to look up and load that object from the list of ActiveX objects registered with the operating system. Table 1 shows the changes from Project 2003 to Project 2007.
Project 2003 ClassID
Project 2007 ClassID
Document event object
Application event object
For objects not listed in this table, such as the progress wizard (clsid:0713E8D2-850A-101B-AFC0-4210102A8DA7), the ClassID has not changed in Project 2007.
The Critical Path custom Project Guide sample in the Project 2003 SDK does not work with Project 2007 unless you update the sample; however, it is relatively easy to do. The updated version is located in the path Code Samples\ProjectGuide\CriticalPathCustomProjectGuide subdirectory of the Project 2007 SDK download. The files in the sample have the following functions:
CritPath.htm contains the calls to JScript methods and the HTML code that controls the Project Guide sidepane content (Figure 1). This file needs no changes.
CritPath.js includes the methods that initialize the sidepane, move to the next or previous critical task, apply a style to the critical tasks in the Gantt chart, and update the sidepane when the user selects a task. This file needs no changes.
CritPath_help.htm contains the HTML content for help with the Critical Path Project Guide, calls the JScript method to display the help header, and calls the method to navigate back to the Critical Path sidepane when the user clicks Done. The onClick event handler in this file is changed from the Project 2003 version to match the task ID value specified in CritPathSample.xml.
CritPathSample.xml includes all of the default Project Guide goal areas and tasks plus the additional task definition for the Critical Path monitor in the Report goal area. This file is changed from the Project 2003 version.
The CritPathSample.xml file is modified from the default gbui.xml file. (Microsoft Project 2002 introduced the Project Guide. One of the pre-release versions was called the Goal Based User Interface.) The gbui.xml file includes the four default goal areas of Tasks, Resource, Track, and Report, plus the 38 task definitions for the goal areas. For example, the first default task in the Report goal area is Select a view or report. The CritPathSample.xml file is simply a copy of gbui.xml with the following definition added as the last task in the Report goal area definition.
The TaskID value must be unique throughout all Project Guide tasks. The highest number task in the default gbui.xml file is 38, so the Critical Path TaskID is set to 39.
<GoalAreaTask> <TaskID> 39 </TaskID> <Title> Critical path monitor </Title> <TaskName> Monitor the critical path </TaskName> <URL> pgcontent://critpath.htm </URL> <TaskHelp> <HelpName> More Information </HelpName> <URL> pgcontent://critpath_help.htm </URL> </TaskHelp> <RelevantViews> <ViewName> Gantt Chart </ViewName> </RelevantViews> </GoalAreaTask>
The URL values of the task content and help content in the Project Guide sidepane use the pgcontent:// custom protocol. For example, if you configure Project to use a custom Project Guide located in the path C:\CustomPG, Project expands pgcontent://critpath.htm to C:\CustomPG\critpath.htm.
The other change from the Project 2003 version is in the CritPath_help.htm file. The following code defines the Done link in the help content. The first two parameters in the pNavigate method are GoalArea and TaskID. In the updated CritPath_help.htm file, the GoalArea value remains 4 (Report), and the TaskID value is changed to 39 to match the task definition in the CritPathSample.xml file.
<a title="Done" id="GoBack" class="trigger" href="#" onClick="pNavigate(4,39,'GoBack')"> Done </a>
There are several ways to deploy and install custom Project Guides. This article shows how to install the Critical Path Project Guide locally for one user of Project Standard or Project Professional, and how to deploy and install the Project Guide for all users with access to a specific SharePoint site. For more information, see Deploying a Custom Project Guide in the Project 2003 SDK.
Installing Locally for One User
Procedure 1 shows a way to install the Critical Path sample on a local computer for one user.
Procedure 1: To install and use the Critical Path custom Project Guide locally:
Copy all of the files for the custom Project Guide to a directory on your computer. For example, create a directory named C:\CustomPG, and then copy the four Critical Path custom Project Guide files to that directory.
Start Project, and then set macro security to medium or low. On the Tools menu, click Options, click the Security tab, and then click Macro Security to open the Security dialog box. Exit Project after you set macro security.
Start Project again, and then create a test project with some tasks, as shown in earlier in Figure 1.
Press ALT-F11 to open the Visual Basic Editor, expand the ProjectGlobal (Global.MPT) node in the Project Explorer pane, and then double-click ThisProject (Global.MPT) to open the code pane.
Paste the following code into the code pane.
Option Explicit Sub SetProjectGuide() Dim url4Layout As String Dim url4Xml As String If Projects.Count = 0 Then MsgBox "You must have at least one active project open to set custom Project Guide files." Exit Sub End If Application.OptionsInterfaceEx DisplayProjectGuide:=True _ ' ProjectGuideUseDefaultFunctionalLayoutPage:=True, _ ' ProjectGuideUseDefaultContent:=False If (ActiveProject.ProjectGuideUseDefaultContent = True) Then 'Set url4Xml to URL of XML document defining content. url4Xml = "C:\CustomPG\CritPathSample.xml" 'Set url4Layout to the URL of HTML page defining layout and functionality. 'url4Layout = "" With ActiveProject .ProjectGuideUseDefaultContent = False .ProjectGuideContent = url4Xml .ProjectGuideUseDefaultFunctionalLayoutPage = True '.ProjectGuideFunctionalLayoutPage = url4Layout End With End If End Sub
The last two settings in Application.OptionsInterfaceEx duplicate the same settings in the With ActiveProject block. You can use either group of settings.
The Critical Path custom Project Guide requires only an option setting change to use a different XML file for custom goal area and task content. All of the other Project Guide functionality and layout content uses the default files.
Save and then close the Visual Basic Editor.
Run the SetProjectGuide macro. For example, on the Tools menu, click Macro, and then click Macros. In the Macros dialog box, select Global.MPT!SetProjectGuide, and then click Run.
In Figure 1, the Set Project Guide custom button on the toolbar is assigned the SetProjectGuide macro. The toolbar button works if the macro is in Global.MPT, but the button does not work if the macro is in the local project.
To determine whether the macro changed settings for Project, open the Options dialog box (Tools menu), and then click the Interface tab. Display Project Guide should be selected. The Use custom content option should be selected under Project Guide Content, and the value C:\CustomPG\CritPathSample.xml should be in the XML file for custom content text box.
Click Report on the Project Guide toolbar or click the down arrow to the right of Report to see the Project Guide task list for that goal area. You can then click Monitor the critical path in the Report sidepane or in the task list.
Deploying to a SharePoint Site
To make the custom Project Guide files easily available to multiple Project Professional users in a project team, a department, or an entire organization, you can copy the files to a SharePoint document library that is accessible to the users. Procedure 2 shows how to deploy the Critical Path custom Project Guide to a project team site. Procedure 3 then shows how to create a custom toolbar button in the enterprise global template that installs the Project Guide.
Procedure 2: To deploy and use the Critical Path Project Guide on a SharePoint site:
Copy the custom Project Guide files to a Shared Documents library that is accessible to the project team. For example, if the top-level SharePoint Web site for the team is http://ServerName/default.aspx, upload the files to http://ServerName/Shared%20Documents/Forms/AllItems.aspx.
On the Shared Documents page of the project team site, click Upload, and then click Upload Multiple Documents.
Browse to C:\CustomPG (or the location of the files), select the four Critical Path files (critpath.htm, critpath.js, critpath_help.htm, and CritPathSample.xml), and then click OK.
On the Shared Documents page, click CritPathSample.xml and open it in Read Only mode. Copy the URL of the file, for example, http://ServerName/Shared%20Documents/CritPathSample.xml.
Change the value of the url4Xml variable in the SetProjectGuide macro as shown in the following line.
Using the Project Guide with a Custom Toolbar in the Enterprise Global Template
To give multiple Project Professional users easy access to the custom Project Guide in the SharePoint document library, you can create a custom toolbar and button in the enterprise global template.
The Knowledge Base (KB) article 913678 How to make a custom toolbar available to all users in Project Professional 2003 or in Project Professional 2002 also generally applies to Project Professional 2007. Project Server 2007 does not include an actual project template named Enterprise Global. What is usually referred to as the enterprise global template is actually binary data in a set of tables in the Published database. The steps in Procedure 3 are modified from the KB article.
Procedure 3: To create a custom toolbar in the enterprise global template for the Critical Path Project Guide:
Copy the module that includes the SetProjectGuide macro to the enterprise global template. You must copy the macro from Global.MPT to another project module before copying it to the enterprise global template.
Start Project Professional, log on to your Project Server profile, and then open the Visual Basic Editor for the empty Project1. Make sure the macro security level is set to medium or low.
In the left pane of the Visual Basic Editor, expand the nodes under VBAProject (Project 1). Right-click VBAProject (Project 1), and then insert a new module.
Expand the ProjectGlobal (Global.MPT) nodes, open ThisProject (Global.MPT), and then copy the SetProjectGuide macro.
Double-click Module1 of VBAProject (Project1), and then paste the macro into Module 1. You do not have to save Project1; just keep it open until you have completed the next steps.
Rename the VBA module. Click in the Project Professional window with Project1 open, and then click Organizer on the Tools menu. Click the Modules tab, select Project1 in the left drop-down list, click Module1 in the left column, and then click Rename. For example, rename Module1 to CustomProjectGuides. Close the Organizer dialog box.
On the Tools menu, point to Enterprise Options, and then click Open Enterprise Global. If you have set the macro security level to medium and you see a Security Notice dialog box, click Enable Macros.
With the Checked-out Enterprise Global project open, open the Organizer dialog box again. Click the Modules tab, select Project1 in the left Modules available in drop-down list, and then click CustomProjectGuides in the left column.
In the Modules available in drop-down list on the right side, select Checked-out Enterprise Global, and then click Copy. Close the Organizer dialog box.
Save the enterprise global template, and then exit Project Professional. To use macros in the enterprise global template, you must restart Project Professional.
Create a custom toolbar and button in a new Project1, and then assign the SetProjectGuide macro in the enterprise global template to the button.
Start Project Professional and log on your Project Server profile. If you see the Security Notice dialog box, click Enable Macros. Project Professional creates a new Project1.
On the Tools menu, point to Customize, and then click Toolbars.
On the Toolbars tab, click New, and then type a name in the New Toolbar dialog box. For example, type CustomPG. Click OK in the New Toolbar dialog box to create an empty floating toolbar.
Click the Commands tab, and then click All Macros in the Categories list. The Commands list then shows the SetProjectGuide macro that you copied to the enterprise global template.
Macros with the Global.MPT! prefix are in the local Global.MPT template, not in the enterprise global template. If you open the Visual Basic Editor and expand the Modules node under VBAProject(Global(+ non-cached Enterprise)), you can see that the CustomProjectGuides VBA module contains the SetProjectGuide macro.
You do not need to reopen the enterprise global template to do the next step.
Drag the SetProjectGuide macro from the Commands list to the floating CustomPG toolbar, right-click the new macro button on the toolbar, and then click Image and Text if you want to show both an icon and text name for the button. You can also change the button name and image.
Click the CustomPG title bar on the floating toolbar, drag it to the toolbar pane, and then dock the toolbar where you want. Close the Customize dialog box.
Test the CustomPG toolbar. Click the button to run the SetProjectGuide macro, and then check the Report goal area to see the Monitor the critical path task. Because you have made no changes to the enterprise global template in Step 2, you do not need to close Project Professional to do Step 3.
Copy the CustomPG toolbar to the enterprise global template, to make it available to all Project Professional users.
With the unsaved Project1 project still open, open the enterprise global template.
With the Checked-out Enterprise Global project open, click Organizer on the Tools menu, and then click the Toolbars tab.
In the Toolbars available in drop-down list on the left side of the Organizer dialog box, select Global (+ non-cached Enterprise).
In the drop-down list on the right, select Checked-out Enterprise Global.
In the left list, click the CustomPG toolbar entry, and then click Copy. Close the Organizer.
Save and then close the enterprise global template.
Exit Project Professional.
Go to a different computer, start Project Professional, log on using the same Project Server profile to verify the new CustomPG toolbar, and then test the SetProjectGuide macro.
Before you can use the macro, you must set macro security to medium or low.
The installation of Project 2007 Standard or Professional includes the pjintl.dll file in the path [Program Files]\Microsoft Office\Office12\1033. The pjintl.dll file contains the default Project Guide files for use by the Project client. For information about how to access the Project Guide files within pjintl.dll by using the res protocol, see Custom Protocols and Localization in the Project 2003 SDK.
Table 2 shows differences in the list of default Project Guide files. Following are the main directories for the default Project Guide files.
Error_pages contains the general HTML pages for security and navigation errors.
Images contains the .gif files for Project Guide sidepanes.
Ooui contains Smart Tag pages.
Pages contains subdirectories for the primary HTML pages for the Project Guide sidepanes.
Scripts contains the JScript files that the HTML pages refer to.
Styles contains the cascading style sheet (.css) files.
Xml contains the primary definitions for the default Project Guide goal areas, tasks, and relevant views.
The main default Project Guide file directories are the same for both Project 2003 and Project 2007, but the pages directory has four new subdirectories (commitments, deliverables, importproject, and importresource).
Commitments and deliverables refer to the same feature. As in the VBA object model for Project, some of the default Project Guide names still use the Commitments name from pre-release versions.
The deleted files are available in Project 2003, but do not work with Project 2007. If you have a custom Project Guide that is based on one of the deleted files as a template, you must adapt the custom file to match one of the new or updated Project Guide files.
Generally, the list of modified files have minor changes, if any. For example, some JScript files have an additional function. HTML files include the DIR="LTR" attribute in the <html> tag, some have changed ClassID values, and some have minor text changes. However, if your custom Project Guide is based on one of the modified HTML or JScript files, you should check whether you need to update custom pages and scripts for Project 2007. The list of modified files does not include files that have only changed comments.