Text2 of assignment1

N

Newbie

Hello,
I need to find via VBA, the string which is in the Text2 field of the
Resource1 (among other resources) which is assigned on the selected task.
How can i do that?
Thanks for your help!
Newbie
 
J

Jan De Messemaeker

Hi,

for each ass in activeselection.tasks(1).assignments
if ass.resourcename="whatever" then
debug.print ass.text1
end if
next ass

HTH
 
N

Newbie

Hi Jan,

Thanks for your answer.
But I already tried this syntax, and I noticed that ass.text1 remains always
empty (blank). While there is not any error message.
NB : I'm using Project Standard 2003.
Thanks for any idea.

Newbie
 
J

Jan De Messemaeker

Right you are.
I misread your question.
But when re-reading it I started wondering:

the string which is in the Text2 field of the

If it is the text2 field of the resource it is irrelevanbt whether the
resource is assigned to the task or not. That would simply be:
Activeproject.resources("Thenameoftheresource").text2

So what exactly do you mean? The assignment's text2 or the resource's?
 
N

Newbie

Jan,

What I need is the Resource's Text2. Is it different from the Assignment's
Text2 ?
Thanks for your help!
 
J

Jan De Messemaeker

Hi,

Well here we are.
Of course they are.
For starters, read FAQ 51 on Data Types (URL of faq s below)

In short, if you need the resource's that has no reference to any task, it
is the resoruce's (just like the resource's name or group) and it can be
accessed as
activeproject.resources("resourcename").text2
It can be looked at in any resource vies (resource sheet, resource usage)

The assignment's OTOH is accessed as I indicated in my first post and it can
NOT be displayed in the resource sheet (since that one does not show
assignments, only resources) nor in the Gantt Chart (shows only tasks not
assignments); it can be displayed in a Usage view (Resource Usage or Task
Usage, the italic lines are the assignments)
HTH
 
N

Newbie

Hi Jan,
<<Activeproject.resources("Thenameoftheresource").text2>>
Thanks a lot!
That worked!
 

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