Supporting material for “Increase Your Productivity by Directly Implementing Your PM Process within MS Project”

Just recently my article about customizing the ribbon in Project Professional was published: http://www.mpug.com/articles/increase-productivity-directly-implementing-pm-process-within-ms-project and at the web event http://www.mpug.com/event/increase-productivity-directly-implementing-pm-process-within-ms-project/ we will have a closer look on the approach but I also wanted to share some of the little helpers I am using.

Create new project from template

Sub NewProjectFromTemplate()
    Call Application.FileNew(Template:="C:\Templates\Software Development.mpt")
End Sub

Set initial baseline

Sub BaselineSaveInitial()
    Call Application.BaselineSave(True, pjCopyCurrent, pjIntoBaseline)
End Sub

Apply view

Sub ViewApply_Plan()
    Call Application.ViewApply("Gantt with Timeline", True)
End Sub

Change task type to fixed duration


Sub changeTasksToFixedDuration()
    Dim changeTask As Boolean
    
    For Each t In Application.ActiveProject.Tasks
        If Not t Is Nothing Then 'ignore empty row
        If (t.ExternalTask = True) Then changeTask = False 'ignore external tasks
        If (t.Summary = True) Then changeTask = False 'ignore summary tasks
        If (t.Type = task_type) Then changeTask = False 'ignore same task-type
        If (Len(t.ResourceNames) = 0) Then changeTask = False 'if no resources, no rule-of-three applies
        If (t.Milestone = True) Then changeTask = False 'ignore milestones
        If (t.Active = False) Then changeTask = False 'ignore inactive tasks
        If (t.PercentComplete = 100) Then changeTask = False 'ignore completed tasks
        If changeTask Then t.Type = pjFixedDuration
        End If 'is nothing
    Next t
End Sub

Add custom ribbon via VBA

Sub AddCustomRibbon()

Dim ribbonXML As String
    ribbonXML = ""
    
'---Ribbon XML definition
    ribbonXML = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
    ribbonXML = ribbonXML + "  <mso:ribbon>"
    ribbonXML = ribbonXML + "    <mso:qat/>"
    ribbonXML = ribbonXML + "    <mso:tabs>"

'**************************** Tab ********************************************************************************************************************************
    ribbonXML = ribbonXML + "      <mso:tab id=""tab_Data"" label=""Process"" insertBeforeQ=""mso:TabTask"">"
'*****************************************************************************************************************************************************************


'**************************** File *******************************************************************************************************************************
    ribbonXML = ribbonXML + "        <mso:group id=""group_File"" label=""File"" autoScale=""true"">"
    ribbonXML = ribbonXML + "           <mso:button idMso=""FileOpen"" label=""Open""/>"
    ribbonXML = ribbonXML + "           <mso:button idMso=""FileSave"" label=""Save""/>"
    ribbonXML = ribbonXML + "           <mso:button idMso=""FilePublish"" label=""Publish""/>"
    ribbonXML = ribbonXML + "        </mso:group>"
'*****************************************************************************************************************************************************************

'**************************** Initiate ***************************************************************************************************************************
    ribbonXML = ribbonXML + "        <mso:group id=""group_Init"" label=""Initiation"" autoScale=""true"" >"
    ribbonXML = ribbonXML + "          <mso:menu id=""Init_1_menu"" label=""Initiate"" imageMso=""SignatureLineInsert"" size=""large"">"
    ribbonXML = ribbonXML + "            <mso:button id=""Init_1_1"" label=""New Project from template"" imageMso=""CacheListData"" onAction=""NewProjectFromTemplate"" />"
    ribbonXML = ribbonXML + "            <mso:menuSeparator id=""Init_1_2"" />"
    ribbonXML = ribbonXML + "            <mso:button idMso=""ProjectInformationDialog"" label=""Project Information""/>"
    ribbonXML = ribbonXML + "            <mso:button id=""Init_1_4"" imageMso=""BaselineSave"" label=""Set initial baseline"" onAction=""BaselineSaveInitial""/>"
    ribbonXML = ribbonXML + "            <mso:menuSeparator id=""Init_1_5_separator"" />"
    ribbonXML = ribbonXML + "            <mso:button idMso=""FileSave"" label=""Save""/>"
    ribbonXML = ribbonXML + "            <mso:button idMso=""FilePublish"" label=""Publish""/>"
    ribbonXML = ribbonXML + "          </mso:menu>"
    ribbonXML = ribbonXML + "        </mso:group>"
'*****************************************************************************************************************************************************************


'**************************** Tab ********************************************************************************************************************************
    ribbonXML = ribbonXML + "      </mso:tab>"
'*****************************************************************************************************************************************************************

'---Ribbon XML definition
    ribbonXML = ribbonXML + "    </mso:tabs>"
    ribbonXML = ribbonXML + "  </mso:ribbon>"
    ribbonXML = ribbonXML + "</mso:customUI>"
    
    ActiveProject.SetCustomUI (ribbonXML)

End Sub

Icons Gallery
http://www.microsoft.com/en-us/download/details.aspx?id=21103

Advertisements

One thought on “Supporting material for “Increase Your Productivity by Directly Implementing Your PM Process within MS Project”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s