Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.51 KB

Project.Application.DurationFormat.md

File metadata and controls

52 lines (35 loc) · 1.51 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.DurationFormat method (Project)
vbapj.chm131212
vbapj.chm131212
project-server
Project.Application.DurationFormat
37970edc-c6f9-66b7-7c0d-b22beb8a36c1
06/08/2017
medium

Application.DurationFormat method (Project)

Returns a duration in the specified units.

Syntax

expression. DurationFormat( _Duration_, _Units_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Duration Required Variant The duration to be expressed.
Units Optional Long The units used to express the duration. Can be one of the PjFormatUnit constants.

Return value

String

Remarks

The time label that appears next to the duration uses the format specified by the timescale as: setting on the Edit tab of the Options dialog box, where timescale is "Minutes", "Hours", "Days", "Weeks", "Months", or "Years".

For example, if Duration is "2w", Units is pjDays, and the Days as: setting is "day", the DurationFormat method returns "10 days".

Example

The following example displays the duration of the selected task in weeks.

Sub DurationInWeeks() 
 MsgBox DurationFormat(ActiveCell.Task.Duration, pjWeeks) 
End Sub

[!includeSupport and feedback]