how to assign resource to a task using vb.net?

J

Johnathan

hi, could anyone tell me how to assign a resource to a task using vb.net?
Also, how can I get the assigned units of a resources to a task? E.g. Task 1
has assigned with resourceA and the units allocated are 50%, so how can i get
the unit (50%) programmatically?
 
J

Jan De Messemaeker

Hi Johnathan,

Again, VBA but you cantransfer that to VB.Net can't you?

Assigning, straight from the help:
============================================================
Assignments.Add Method
Adds an Assignment object to Assignments collection.
expression.Add(TaskID, ResourceID, Units)

Return Value
Assignment

expression A variable that represents an Assignments object.

Parameters

Name Required/Optional Data Type Description
TaskID Optional Long . The identification number of a task. Required
if the parent object is a resource. The task is assigned the resource
specified with ResourceID. The default value of TaskID is the identification
number of the parent object of the Assignments collection if the parent
object is a Task object.
ResourceID Optional Long The identification number of a resource.
Required if the parent object is a task. The resource is assigned the task
specified with the TaskID argument. The default value of ResourceID is the
identification number of the parent object of the Assignments collection if
the parent object is a Resource object.
Units Optional Variant The number of resource units, expressed as a
decimal or percentage, to assign to the task. The default value is 1 or
100%, depending upon the Show assignment units as a setting on the Schedule
tab of the Options dialog box. If the maximum number of units is less than 1
(or the maximum percentage is less than 100%), the default value of the
Units argument is the maximum number of units (or the maximum percentage).

====================================================================

To read the units:
thetask.assignments(4).Units

Hope this helps,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top