Click to Rate and Give Feedback
MSDN
MSDN Library
Office Development
Project 2003
SDK Documentation
References
Methods
T
 TimeScaleData Method

  Switch on low bandwidth view
 
TimeScaleData Method

Returns timephased information for an assignment, resource, or task.

Syntax

expression .TimeScaleData(StartDate, EndDate, Type, TimeScaleUnit, Count)

expression        Required. An expression that returns an object in the Applies To list.

StartDate     Required Variant. The start date for the timephased data. If the start date falls within an interval, it is "rounded" to the start of the interval. For example, if TimeScaleUnit was pjTimescaleWeeks and StartDate specified a Wednesday, it would be rounded to the preceding Monday (assuming the work week started on a Monday).

EndDate     Required Variant. The end date for the timephased data. If the end date falls within an interval, it is "rounded" to the end of the interval.

Type     Optional Long. The type of timephased data. The default value is pj expression    TimescaledWork, where expression is Assignment, Resource, or Task.




TimeScaleUnit     Optional Long. Can be one of the following PjTimescaleUnit constants: pjTimescaleYears, pjTimescaleQuarters, pjTimescaleMonths, pjTimescaleWeeks, pjTimescaleDays, pjTimescaleHours, pjTimescaleMinutes. The default value is pjTimescaleWeeks.

Count     Optional Long. The number of timescale units to group together. The default value is 1.

Remarks

The TimeScaleData method should be used instead of the TimeScaledData method, which is hidden by default in the object browser.

Example

The following example displays the number of hours of work per day for a resource during the first full week in October. It assumes a resource view is the active view.

			Sub WorkHoursPerDay()
    Dim TSV As TimeScaleValues, HowMany As Long
    Dim HoursPerDay As String

    Set TSV = ActiveCell.Resource.TimeScaleData("10/7/02", "10/11/02", _
        TimescaleUnit:=pjTimescaleDays)

    For HowMany = 1 To TSV.Count
        If TSV(HowMany).Value = "" Then
            HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
                TSV(HowMany).EndDate & ": 0 hours" & vbCrLf
        Else
            HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
                TSV(HowMany).EndDate & ": " & TSV(HowMany).Value / 60 & _
                    " hours" & vbCrLf
        End If
    Next HowMany

    MsgBox HoursPerDay

End Sub
		




© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker