Table of contents
TOC
Collapse the table of content
Expand the table of content

Application Object (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Represents the entire Project application. The Application object contains:

  • Application-wide settings and options (many of the options in the Options dialog box on the Tools menu, for example).

  • Properties that return top-level objects, such as ActiveCell, ActiveProject, and so forth.

  • Methods that act on application-wide elements, such as views, selections, editing actions, and so forth.

Using the Application Object

Use the Application property to return an Application object in Project . The following example applies the Windows property to the Application object.

Application.Windows("Project1.mpp").Activate

Using Project From Another Application: Late Binding

The following example creates the Microsoft Project Application object at run time, creates a new project, adds a task, saves the project, and then closes the Project . For example, copy and paste the CreateProject_Late macro to the ThisDocument module in the Visual Basic Editor (VBE) of Word.

Note Because the application queries the MSProject.Application type library only at run time, Microsoft IntelliSense is not available and performance is relatively poor with late binding. Scripting languages, such as JavaScript and VBScript, require late binding. VBScript supports only the generic Object and Variant data types. For better performance in VBA and other compiled languages, you should use early binding by setting a reference to the Project type library.

Sub CreateProject_Late() 
    Dim pjApp As Object 
    Set pjApp = CreateObject("MSProject.Application") 
    pjApp.Visible = True 
    pjApp.FileNew 
    pjApp.ActiveProject.Tasks.Add "Hang clocks" 
    pjApp.FileSaveAs "Clocks.mpp" 
    pjApp.FileClose 
    pjApp.Quit 
End Sub

If you do not set the Visible property to True, the Project application operates in the background without being visible.

Using Project From Another Application: Early Binding

Early binding has better performance because it loads the type library at design time. To use early binding, you must set a reference to the Project application from the application you are working in. For example, in the VBE for a Word document, click References on the Tools menu, scroll through the Available References list, and then choose the Microsoft Project 15.0 Object Library checkbox.

The following example opens a project from another application such as Excel , adds a task, and then saves and closes the project.

Sub ModifyProject_Early() 
    Dim pjApp As MSProject.Application 
    Set pjApp = New MSProject.Application 
    pjApp.Visible = True 
    pjApp.FileOpen "Clocks.mpp" 
    pjApp.ActiveProject.Tasks.Add "Wind clocks" 
    pjApp.FileSave 
    pjApp.FileClose 
    pjApp.Quit 
End Sub

Remarks

Important For application-level events, register event handlers after you set Application.Visible = True.

If you instantiate Project from another application and register an application-level event before setting the Visible property of the Application object to True, the properties and methods of child objects of Application do not work. For example, Application.ActiveProject.Name is not accessible.

Many of the properties and methods that return the most common user-interface objects, such as the active project—represented by the ActiveProject property—can be used without the Application object qualifier. For example, instead of writing Application.ActiveProject.Visible = True you can write ActiveProject.Visible = True

Events

Name
AfterCubeBuilt
ApplicationBeforeClose
ConnectionStatusChanged
IsFunctionalitySupported
JobCompleted
JobStart
LoadWebPage
LoadWebPane
NewProject
OnUndoOrRedo
PaneActivate
ProjectAfterSave
ProjectAssignmentNew
ProjectBeforeAssignmentChange
ProjectBeforeAssignmentChange2
ProjectBeforeAssignmentDelete
ProjectBeforeAssignmentDelete2
ProjectBeforeAssignmentNew
ProjectBeforeAssignmentNew2
ProjectBeforeClearBaseline
ProjectBeforeClose
ProjectBeforeClose2
ProjectBeforePrint
ProjectBeforePrint2
ProjectBeforePublish
ProjectBeforeResourceChange
ProjectBeforeResourceChange2
ProjectBeforeResourceDelete
ProjectBeforeResourceDelete2
ProjectBeforeResourceNew
ProjectBeforeResourceNew2
ProjectBeforeSave
ProjectBeforeSave2
ProjectBeforeSaveBaseline
ProjectBeforeTaskChange
ProjectBeforeTaskChange2
ProjectBeforeTaskDelete
ProjectBeforeTaskDelete2
ProjectBeforeTaskNew
ProjectBeforeTaskNew2
ProjectCalculate
ProjectResourceNew
ProjectTaskNew
SaveCompletedToServer
SaveStartingToServer
SecondaryViewChange
WindowActivate
WindowBeforeViewChange
WindowDeactivate
WindowGoalAreaChange
WindowSelectionChange
WindowSidepaneDisplayChange
WindowSidepaneTaskChange
WindowViewChange
WorkpaneDisplayChange

Methods

Name
About
ActivateMicrosoftApp
AddNewColumn
AddProgressLine
AddResourcesFromProjectServer
AddSiteColumn
AfterUnloadWebBrowserControl
Alerts
AlignTableCellBottom
AlignTableCellTop
AlignTableCellVerticalCenter
AppExecute
ApplyReport
ApplyReportLayoutTemplate
AppMaximize
AppMinimize
AppMove
AppRestore
AppSize
AutoCorrect
AutoFilter
AutoSaveToGlobal
BarBoxFormat
BarBoxStyles
BarRounding
BaseCalendarCreate
BaseCalendarDelete
BaseCalendarEditDays
BaseCalendarRename
BaseCalendarReset
BaseCalendars
BaselineClear
BaselineSave
BoxAlign
BoxCellEdit
BoxCellEditEx
BoxCellLayout
BoxDataTemplate
BoxFormat
BoxFormatEx
BoxGetXPosition
BoxGetYPosition
BoxLayout
BoxLayoutEx
BoxLinkLabelsShow
BoxLinks
BoxLinksEx
BoxLinkStyleToggle
BoxProgressMarksShow
BoxSet
BoxShowHideFields
BoxStylesEdit
BoxStylesEditEx
BoxZoom
CacheSettings
CacheStatus
CalculateAll
CalculateProject
CalendarBarStyles
CalendarBarStylesEdit
CalendarBarStylesEditEx
CalendarBestFitWeekHeight
CalendarDateBoxes
CalendarDateBoxesEx
CalendarDateShading
CalendarDateShadingEdit
CalendarDateShadingEditEx
CalendarLayout
CalendarShowBarSplits
CalendarTaskList
CalendarTimescale
CalendarWeekHeadingsEx
ChangeColumnDataType
ChangeStatusDate
ChangeWorkingTimeEx
CheckField
CheckIn
CheckOut
CheckResourceErrors
CheckTaskErrors
CleanupCache
CleanupProjectFromCache
ClearConstraint
CloseComparison
CloseUndoTransaction
ColumnAlignment
ColumnBestFit
ColumnDelete
ColumnEdit
ColumnInsert
ComAddInsDialog
CommitmentsPane
CompareProjectsLegendToggle
CompareProjectVersions
ConsolidateProjects
ConvertHangulToHanja
CopyReport
CreateComparisonReport
CreateEnterpriseCalendar
CreateProjectSite
CustomFieldDelete
CustomFieldGetFormula
CustomFieldGetName
CustomFieldIndicatorAdd
CustomFieldIndicatorDelete
CustomFieldIndicators
CustomFieldMappingDialog
CustomFieldPropertiesEx
CustomFieldRename
CustomFieldSetFormula
CustomFieldValueList
CustomFieldValueListAdd
CustomFieldValueListDelete
CustomFieldValueListGetItem
CustomForms
CustomizeField
CustomizeIMEMode
CustomOutlineCodeEditEx
DateAdd
DateDifference
DateFormat
DateSubtract
DDEExecute
DDEInitiate
DDELinksUpdate
DDEPasteLink
DDETerminate
DeleteFromDatabase
DependenciesPane
DetailsPaneToggle
DetailStylesAdd
DetailStylesFormat
DetailStylesFormatEx
DetailStylesProperties
DetailStylesRemove
DetailStylesRemoveAll
DetailStylesToggleItem
DisplaySharedWorkspace
DistributeTableColumns
DistributeTableRows
DocClose
DocMaximize
DocMove
DocRestore
DocSize
DocumentExport
DocumentLibraryVersionsDialog
DrawingCreate
DrawingCycleColor
DrawingMove
DrawingProperties
DrawingReshape
DurationFormat
DurationValue
EditClear
EditClearFormats
EditClearHyperlink
EditCopy
EditCopyPicture
EditCut
EditDelete
EditEnterpriseCalendar
EditGoTo
EditHyperlink
EditInsert
EditPaste
EditPasteAsHyperlink
EditPasteSpecial
EditRedo
EditTPStyle
EditUndo
EnterpriseGlobalCheckOut
EnterpriseMakeServerURLTrusted
EnterpriseProjectDelete
EnterpriseProjectImportWizard
EnterpriseProjectProfiles
EnterpriseResourceGet
EnterpriseResourcesImportEx
EnterpriseResourcesOpen
EnterpriseResSubstitutionWizard
EnterpriseTeamBuilder
FieldConstantToFieldName
FieldNameToFieldConstant
FileCloseAllEx
FileCloseEx
FileExit
FileLoadLast
FileNew
FileOpenEx
FileOpenOrCreate
FileOpenUsingBackstage
FilePageSetup
FilePageSetupCalendar
FilePageSetupCalendarText
FilePageSetupCalendarTextEx
FilePageSetupFooter
FilePageSetupHeader
FilePageSetupLegend
FilePageSetupLegendEx
FilePageSetupMargins
FilePageSetupPage
FilePageSetupView
FilePrint
FilePrintPreview
FilePrintSetup
FileProperties
FileSave
FileSaveAs
FileSaveOffline
FileSaveWorkspace
FillAcross
FillDown
FilterApply
FilterClear
FilterEdit
FilterNew
Filters
FilterShowSummaryRows
Find
FindEx
FindFile
FindNext
FindPrevious
FollowHyperlink
Font32Ex
FontBold
FontEx
FontItalic
FontStrikethrough
FontUnderLine
Form
FormatCopy
FormatPainter
FormatPaste
FormViewShow
GanttBarEditEx
GanttBarFormat
GanttBarFormatEx
GanttBarLinks
GanttBarSize
GanttBarStyleBaseline
GanttBarStyleCritical
GanttBarStyleDelete
GanttBarStyleEdit
GanttBarStyleLate
GanttBarStyleSlack
GanttBarStyleSlippage
GanttBarTextDateFormat
GanttChartWizard
GanttRollup
GanttShowBarSplits
GanttShowDrawings
GetCellInfo
GetCurrentTheme
GetProjectServerSettingsEx
GetProjectServerVersion
GetRedoListCount
GetRedoListItem
GetThemedColor
GetUndoListCount
GetUndoListItem
GoalAreaChange
GoalAreaHighlight
GoalAreaTaskHighlight
GoToItemInVersions
GotoNextOverAllocation
GotoTaskDates
Gridlines
GridlinesEdit
GridlinesEditEx
GroupApply
GroupBy
GroupClear
GroupMaintainHierarchy
GroupNew
Groups
HelpAbout
HelpAnswerWizard
HelpContents
HelpLaunch
HelpTechnicalSupport
HighlightDrivenSuccessors
HighlightDrivingPredecessors
HighlightPredecessors
HighlightSuccessors
ImportCommitment
ImportOutlookTasks
InactivateTaskToggle
InformationDialog
InsertBlankRow
InsertHyperlink
InsertManualTask
InsertMilestoneTask
InsertNotes
InsertResource
InsertScheduledTask
InsertSummaryTask
InsertTask
IsCommandEnabled
IsOfficeTaskPaneVisible
IsOffline
IsReducedFunctionalityMode
IsUndoingOrRedoing
IsURLTrusted
Layout
LayoutNow
LayoutRelatedNow
LayoutSelectionNow
LevelingClear
LevelingOptions
LevelingOptionsEx
LevelNow
LevelSelected
LinksBetweenProjects
LinkTasks
LinkTasksEdit
LinkToTaskList
LoadWebBrowserControlEx
LoadWebPaneControl
LocaleID
LookUpTableAddEx
Macro
MacroSecurity
MacroShowCode
MacroShowVba
MailLogoff
MailLogon
MailPostDocument
MailRoutingSlip
MailSend
MailSession
MailSystem
MakeFieldEnterprise
MakeLocalCalendarEnterprise
ManageSiteColumns
MapEdit
Message
NewTasksStartOn
ObjectChangeIcon
ObjectConvert
ObjectInsert
ObjectLinks
ObjectVerb
OfficeOnTheWeb
OfficeTaskPaneHide
OpenBrowser
OpenFromSharePoint
OpenServerPage
OpenUndoTransaction
OpenXML
OptionsCalculation
OptionsCalendar
OptionsEditEx
OptionsGeneralEx
OptionsInterfaceEx
OptionsSave
OptionsSchedule
OptionsSecurityEx
OptionsSecurityTab
OptionsSpelling
OptionsViewEx
Organizer
OrganizerDeleteItem
OrganizerMoveItem
OrganizerRenameItem
OutlineHideSubTasks
OutlineIndent
OutlineOutdent
OutlineShowAllTasks
OutlineShowSubTasks
OutlineShowTasks
OutlineSymbolsToggle
PageBreakRemove
PageBreakSet
PageBreaksRemoveAll
PageBreaksShow
PaneClose
PaneCreate
PaneNext
PanZoomPanTo
PanZoomZoomTo
PasteAsPicture
PasteDestFormatting
PasteSourceFormatting
ProgressLines
ProjectCheckOut
ProjectMove
ProjectStatistics
ProjectSummaryInfo
Publish
Quit
ReassignSelectedAssns
RecurringTaskInsert
Redo
RegisterProject
ReminderSet
RemoveHighlight
RenameReport
Replace
ReplaceEx
ReportPrint
ReportPrintPreview
Reports
ReportsDialog
RequestProgressInformation
RescheduleToNextAvailable
ResetTPStyle
ResourceActiveDirectory
ResourceAddressBook
ResourceAssignment
ResourceAssignmentDialog
ResourceCalendarEditDays
ResourceCalendarReset
ResourceCalendars
ResourceComparison
ResourceDetails
ResourceGraphBarStyles
ResourceGraphBarStylesEx
ResourceMappingDialog
ResourceSharing
ResourceSharingPoolAction
ResourceSharingPoolRefresh
ResourceSharingPoolUpdate
ResourceWindowsAccount
RestoreSheetSelection
RowClear
RowDelete
RowInsert
Run
SaveForSharing
SaveSheetSelection
SegmentBorderColor
SegmentFillColor
SelectAll
SelectBeginning
SelectCell
SelectCellDown
SelectCellLeft
SelectCellRight
SelectCellUp
SelectColumn
SelectEnd
SelectionExtend
SelectRange
SelectResourceCell
SelectResourceColumn
SelectResourceField
SelectRow
SelectRowEnd
SelectRowStart
SelectSheet
SelectTable
SelectTaskAssns
SelectTaskCell
SelectTaskColumn
SelectTaskField
SelectTimescaleRange
SelectToEnd
SelectTPLineHeight
SelectTPTask
ServiceOptionsDialog
SetActiveCell
SetAutoFilter
SetField
SetLTRTable
SetMatchingField
SetResourceField
SetResourceFieldByID
SetRowHeight
SetRTLTable
SetShowTaskSuggestions
SetShowTaskWarnings
SetSidepaneStateButton
SetSplitBar
SetTaskField
SetTaskFieldByID
SetTaskMode
SetTitleRowHeight
SetTPField
ShareProjectOnline
ShowAddNewColumn
ShowIgnoredTaskWarnings
ShowOSFTaskPane
ShowReportDataPane
SidepaneTaskChange
SidepaneToggle
Sort
SpellCheckField
SpellingCheck
SplitTask
StopWebBrowserControlNavigation
SummaryResourceAssignmentsRefresh
SummaryTasksShow
SynchronizeWithSite
Table
TableApply
TableCopy
TableEdit
TableEditEx
TableReset
Tables
TaskComparison
TaskDeliverableCreate
TaskDeliverableSync
TaskDependencySync
TaskDrivers
TaskInspector
TaskMove
TaskMoveToStatusDate
TaskOnTimeline
TaskRespectLinks
TextStyles32Ex
TextStylesEx
TimelineExport
TimelineFormat
TimelineGotoSelectedTask
TimelineInsertTask
TimelineShowHide
TimelineTextOnBar
TimelineViewToggle
Timescale
TimescaleEdit
TimescaleNonWorking
TimescaleNonWorkingEx
ToggleAssignments
ToggleChangeHighlighting
TogglePreventResOveralloc
ToggleResourceDetails
ToggleTaskDetails
ToggleTPAutoExpand
ToggleTPResourceExpand
ToggleTPUnassigned
ToggleTPUnscheduled
Undo
UndoClear
UnlinkTasks
UnloadWebBrowserControl
UpdateFromProjectServer
UpdateProject
UpdateTasks
UsageViewEntryEx
ViewApply
ViewApplyEx
ViewBar
ViewCopy
ViewEditCombination
ViewEditSingle
ViewReset
Views
ViewsEx
ViewShowCost
ViewShowCumulativeCost
ViewShowCumulativeWork
ViewShowNotes
ViewShowObjects
ViewShowOverallocation
ViewShowPeakUnits
ViewShowPercentAllocation
ViewShowPredecessorsSuccessors
ViewShowRemainingAvailability
ViewShowResourcesPredecessors
ViewShowResourcesSuccessors
ViewShowSchedule
ViewShowUnitAvailability
ViewShowWork
ViewShowWorkAvailability
VisualReports
VisualReportsEdit
VisualReportsNewTemplate
VisualReportsSaveCube
VisualReportsSaveDatabase
VisualReportsView
WBSCodeMaskEdit
WBSCodeRenumber
WebAddToFavorites
WebCopyHyperlink
WebGoBack
WebGoForward
WebHideToolbars
WebOpenFavorites
WebOpenHyperlink
WebOpenSearchPage
WebOpenStartPage
WebRefresh
WebSetSearchPage
WebSetStartPage
WebStopLoading
WebToolbar
WindowActivate
WindowArrangeAll
WindowHide
WindowMoreWindows
WindowNewWindow
WindowNext
WindowPrev
WindowSplit
WindowUnhide
WorkOffline
WrapText
Zoom
ZoomCalendar
ZoomIn
ZoomOut
ZoomReport
ZoomTimescale
AddEngagement
EngagementInfo
GetDpiScaleFactor
InsertTimelineBar
Inspector
LocaleName
ProjectSummaryInfoEx
RefreshEngagementsForProject
RemoveTimelineBar
SubmitAllEngagementsForProject
SubmitSelectedEngagementsForProject
TaskOnTimelineEx
TimelineBarDateRange
UpdateEngagementsForProject

Properties

Name
ActiveCell
ActiveProject
ActiveSelection
ActiveWindow
AMText
Application
AskToUpdateLinks
Assistance
AutoClearLeveling
AutoLevel
AutomaticallyFillPhoneticFields
AutomationSecurity
Build
Calculation
Caption
CellDragAndDrop
COMAddIns
CommandBars
CompareProjectsCurrentVersionName
CompareProjectsPreviousVersionName
DateOrder
DateSeparator
DayLeadingZero
DecimalSeparator
DefaultAutoFilter
DefaultDateFormat
DefaultView
DisplayAlerts
DisplayEntryBar
DisplayOLEIndicator
DisplayPlanningWizard
DisplayProjectGuide
DisplayRecentFiles
DisplayScheduleMessages
DisplayScrollBars
DisplayStatusBar
DisplayViewBar
DisplayWindowsInTaskbar
DisplayWizardErrors
DisplayWizardScheduling
DisplayWizardUsage
Edition
EnableCancelKey
EnableChangeHighlighting
EnterpriseAllowLocalBaseCalendars
EnterpriseListSeparator
EnterpriseProtectActuals
FileBuildID
FileFormatID
GetCacheStatusForProject
GlobalBaseCalendars
GlobalOutlineCodes
GlobalReports
GlobalResourceFilters
GlobalResourceTables
GlobalTaskFilters
GlobalTaskTables
GlobalViews
GlobalViewsCombination
GlobalViewsSingle
Height
IsCheckedOut
Left
LevelFreeformTasks
LevelIndividualAssignments
LevelingCanSplit
LevelOrder
LevelPeriodBasis
LevelProposedBookings
LevelWithinSlack
ListSeparator
LoadLastFile
MonthLeadingZero
MoveAfterReturn
Name
NewTasksEstimated
OperatingSystem
PanZoomFinish
PanZoomStart
Parent
Path
PathSeparator
PMText
Profiles
Projects
PromptForSummaryInfo
RecentFilesMaximum
ScreenUpdating
ShowAssignmentUnitsAs
ShowEstimatedDuration
ShowWelcome
StartWeekOn
StartYearIn
StatusBar
SupportsMultipleDocuments
SupportsMultipleWindows
ThousandSeparator
TimeLeadingZero
TimescaleFinish
TimescaleStart
TimeSeparator
Top
TrustProjectServerAndWSSPages
TwelveHourTimeFormat
UndoLevels
UsableHeight
UsableWidth
Use3DLook
UseOMIDs
UserControl
UserName
VBE
Version
Visible
VisualReportsAdditionalTemplatePath
VisualReportTemplateList
Width
Windows
Windows2
WindowState
© 2018 Microsoft