
Accessing custom fields in MS Project 2000
Rod,
Does it need to be that complicated?
Each task has a resources collection so you can access the rate of the first
resource on the first task with:
ActiveProject.Tasks(1).Resources(1).StandardRate
or for a custom field like Text20:
ActiveProject.Tasks(1).Resources(1).Text20
--
Please try to keep replies in this group. I do check e-mail, but only
infrequently.
-Jack Dahlgren, Project MVP
+++++++++++++++++++
Quote:
> HI,
> As in the Project interface, you can only see task details in task views.
> The exception is three resource fields:
> Name, Initials and Group.
> These three fields can be seen in Gant views (by inserting a new column
for
> them).
> VBA is the same, you can only see Tasks data for a task object.
> Via an assignment you can get at all relevant resource data.
> EG for a task Test that has resource Res, the following code access the
> Standard Rate for teh first resource assigned to it.
Activeproject.resources(activeproject.tasks("Test").Assignments(1).Resource
I
Quote:
> D).StandardRate
> If T is a variable set to your Task Test then this is a more readable:
> Activeproject.resources(T.Assignments(1).ResourceID).StandardRate
> --
> Visit www.mvps.org/project/ for the Project MVP's FAQ and third party
> add-ons
> Rod Gill
> Microsoft Project MVP
> Visit www.projectlearning.com for customized Project and Office VBA macros
> and Project companion software
> > Hi all,
> > I tried to access custom resource fields from the task context but
failed.
> > Can anyone explain how can I do this. Is there a way of creating global
> > fields accessible from both task and resource contexts.
> > Thanks in advance.
> > Ara