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

Application.TimescaleEdit Method (Project)

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

Enables changing the scale and format of a timescale in a Gantt chart or other timephased view.

Syntax

expression. TimescaleEdit( ** MajorUnits, ** MinorUnits, ** MajorLabel, ** MinorLabel, ** MajorAlign, ** MinorAlign, ** MajorCount, ** MinorCount, ** MajorTicks, ** MinorTicks, ** Enlarge, ** Separator, ** MajorUseFY, ** MinorUseFY, ** TopUnits, ** TopLabel, ** TopAlign, ** TopCount, ** TopTicks, ** TopUseFY, ** TierCount** )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
MajorUnitsOptionalVariantTime units for the middle timescale tier. Specify with the PjTimescaleUnit enumeration. The default value is pjTimescaleWeeks (3).
MinorUnitsOptionalVariantTime units for the bottom timescale tier. Specify with the PjTimescaleUnit enumeration. The default value is pjTimescaleDays (2).
MajorLabelOptionalVariantDate or time labels for the middle timescale tier. Specify with one of the following enumerations: PjDateLabel, PjDayLabel, PjMonthLabel, or PjWeekLabel. The default value is pjWeekLabelWeek_mmm_dd_yyy (13). For example, default values are Mar 7, '10 and Mar 14, '10.
MinorLabelOptionalVariantDate or time labels for the bottom timescale tier. Specify with one of the following enumerations: PjDateLabel, PjDayLabel, PjMonthLabel, or PjWeekLabel. The default value is pjDayLabelDay_di (20). For example, default values are S, M, and T.
MajorAlignOptionalVariantThe PjAlignment enumeration specifies how to align labels within each time period of the middle tier. The default is value is pjLeft (0).
MinorAlignOptionalVariantThe PjAlignment enumeration specifies how to align labels within each time period of the bottom tier. The default is value is pjLeft (0).
MajorCountOptionalVariantSpecifies the time unit interval in which to show labels for the middle tier. For example, if the time unit is weeks, a value of 1 shows a label every week; a value of 2 shows a label every two weeks.
MinorCountOptionalVariantSpecifies the time unit interval in which to show labels for the bottom tier. For example, if the time unit is hours, a value of 1 shows a label every hour; a value of 2 shows a label every two hours.
MajorTicksOptionalVariantSpecifies whether to show tick marks that separate time periods in the middle tier. For example, if the time unit is days, a value of False removes the tick marks between days.
MinorTicksOptionalVariantSpecifies whether to show tick marks that separate time periods in the bottom tier. For example, if the time unit is hours, a value of False removes the tick marks between hours.
EnlargeOptionalVariantSpecifies the percent of horizontal expansion of the timescale. For example, a value of 150 expands the timescale 150%.
SeparatorOptionalVariantSpecifies whether to show the lines that separate the top, middle, and bottom tiers of the timescale. For example, a value of False removes the lines.
MajorUseFYOptionalVariantSpecifies whether to base the middle tier labels on the fiscal year. The default value is False.
MinorUseFYOptionalVariantSpecifies whether to base the bottom tier labels on the fiscal year. The default value is False.
TopUnitsOptionalVariantTime units for the top timescale tier. Specify with the PjTimescaleUnit enumeration. The default value is pjTimescaleMonths (2).
TopLabelOptionalVariantDate or time labels for the top timescale tier. Specify with one of the following enumerations: PjDateLabel, PjDayLabel, PjMonthLabel, or PjWeekLabel. The default value is pjDayLabelDay_di (20). For example, default values are S, M, and T.
TopAlignOptionalVariantThe PjAlignment enumeration specifies how to align labels within each time period of the top tier. The default is value is pjLeft (0).
TopCountOptionalVariantSpecifies the time unit interval in which to show labels for the top tier. For example, if the time unit is months, a value of 1 shows a label every month; a value of 2 shows a label every two months.
TopTicksOptionalVariantSpecifies whether to show tick marks that separate time periods in the top tier. For example, if the time unit is months, a value of False removes the tick marks between months.
TopUseFYOptionalVariantSpecifies whether to base the top tier labels on the fiscal year. The default value is False.
TierCountOptionalVariantSpecifies the number of timescale tiers. The integer value 3 shows all three tiers; the value 2 is default and shows the middle and bottom tiers; the value 1 shows only the middle tier.

Return Value

Boolean

Remarks

To manually edit a timescale in Project, right-click the timescale, and then choose Timescale. Executing the TimescaleEdit method with no parameters displays the Timescale dialog box. If the user choose Cancel, TimescaleEdit returns False. If the user makes valid changes and chooses OK, TimescaleEdit returns True.

Example

The following example sets the timescale to three tiers, where the top tier units are months, the top labels are the month name and year, the middle tier units are weeks, and the middle tier labels are the month and day numbers. For example, top tier labels are May 2012 and June 2012, and middle tier labels are 5/27 and 6/3.

TimescaleEdit TierCount:=3, _ 
    TopUnits:=PjTimescaleUnit.pjTimescaleMonths, _ 
    TopLabel:=PjMonthLabel.pjMonthLabelMonth_mmmm_yyyy, _ 
    MajorUnits:=PjTimescaleUnit.pjTimescaleWeeks, _ 
    MajorLabel:=PjWeekLabel.pjWeekLabelWeek_mm_dd

Note Values for the label time range in the TopLabel, MajorLabel, and MinorLabel parameters must be compatible with the time unit of the specified timescale tier. For example, if the time unit of the bottom tier is hours, the parameter value MinorLabel:=PjDateLabel.pjHour_hhAM is valid. However, the parameter value MinorLabel:=PjDateLabel.pjHalfYear_hhh_Half results in the run time error 1101: "The argument value is not valid."

© 2018 Microsoft