Get the all resume name to task

F

Ferreira Marco

Hi,

I need a help to do a macro in VBA to get all resume name to input in
customize text filed for each task.

I will explain with an example. I will show a WBS.

This colum that I
need

TASK NAME TEXT 1(Customize filed)
0 - NAME OF PROJECT Name of Project( or clean)
1 - Summary Task 1 Summary Task 1 (or clean)
1.1 - Sub summary Task 1.1 Summary Task 1 > Sub summary
Task 1.1
1.1.1 - Task 1 Summary Task 1 > Sub
summary Task 1.1
1.1.2 - Task 2 Summary Task 1 > Sub
summary Task 1.1
1.2 - Sub summary Task 1.2 Summary Task 1 > Sub summary
Task 1.2
1.2.1 - Task 3 Summary Task 1 > Sub
summary Task 1.2
1.2.2 - Task 4 Summary Task 1 > Sub
summary Task 1.2
2 - Summary Task 2 Summary Task 2 (or clean)
2.2 - Sub summary Task 2.2 Summary Task 2 > Sub summary
Task 2.2
2.2.1 - Task 5 Summary Task 2 > Sub
summary Task 2.2
2.2.2 - Task 6 Summary Task 2 > Sub
summary Task 2.2

Anyone can hellp me, please?

Regards,
 
J

Jan De Messemaeker

Hi,

Is 3 the deepest outline level?
If not, what do you show for level4 tasks?

By all means, this can help:

for each anytask in activeproject.tasks
if not anytask is nothing then
if anytask.summary then
anytask.text1=anytask.name
else
anytask.text1=""
end if 'is summary
if anytask.outlinelevel>1 then
set SummTask=anytask
for Counter= 1 to anytask.outlinelevel-1
set summtask=summtask.outlineparent
anytask.text1=summtask.name & " > " & anytask.text1
next counter
end if 'outlinelevel
end if 'nothing
next anytask


Greetings,
 
F

Ferreira, Marco

Jan,

Thank you. It is working all right.

So I need a little more for this macro.

The field TEXT1 it for each task, but I need that is information replace to
all resources in the task. So I change view for TASK USAGE and in this view
each task is showed with all resources. Inn this view if I insert tha TEXT1
column I can see what the macro did just for task, not to resources.

How can I do for this macro copy the information in TEXT1 for all resources
in each task?

Am I clear?

Thanks,
 
J

Jan De Messemaeker

Hi,

Sorry to be precise on this: a task doe not "HAVE" resources, it HAS
assignments.
In task useage,n, tehy are listed by their resource name; in Resource Usage,
they are listed by their task name.
Read all about it in FAQ 51 in
http://www.mvps.org/project/faqs.htm

Now the solution


After end if 'outline level add
For each Asg in anytask.assignments
asg.text1=anytask.text1
next asg

Greetings,
 
F

Ferreira Marco

Thanks Jan,

I have a EPM2007 and a enterprise text field. For use this field.

Is just change for "ENTERPRISE.TEXT.1" in EPM2007?
 
J

Jan De Messemaeker

Hi,

No, better not; access o enterprise fields is limited to the administrator.
Run this in the project and use a normal text field is what I advise.
Greetings,
 
F

Ferreira, Marco

Hi Jan

I'm working with Marco on this. I would like to ask you so what is the
better way to put this macro on a enterprise field.
The custumer needs it on a enterprise field, not on specific project,

Regards

Juliana
 
J

Jan De Messemaeker

OK, then you can replace Text1 by EnterpriseText1 (no blanks or dots)
 
F

Ferreira, Marco

I've just tryied that and didn't work.
I substitue TEXT1 for ENTERPRISETEXT1 and the vb editor gives me an error
message about a invalid value.
What am I doing wrong?
 
J

Jan De Messemaeker

Hi,

1. Indeed, I do not find a way to access assignment enterprise fields
through VBA.
2. But sorry, looking at the problem again, your question doesn't make much
sense. Since the tasks are in one project, why should (or even how could)
the text be visible in an enterprise field?
How can teh customer want a project-specific text in an enterprise field?
 
F

Ferreira, Marco

Hi

Let me explain what I want to do since the begining. Maybe I haven´t been
clear.

A custumer used to use Project Server 2003. About a month ago, they migrated
do Project Server 2007.
About assignment of tasks, PWA2003 has a grid that cointains the
way/tree/levels of all the tasks of the project. With this view, it is better
for resources consult and assignm theis hours on the right tasks.
Although, in PWA2007, at MY TASKS view, there isn´t this grid with the way
of the tasks. It only show the name of the task.
And the custumer says that it´s impossible to work this way.
So, a possible solution that Marco Paulo encoutered is make a costum field
that shows on the view of MY TASKS in PWA, the tree of the tasks.
So you´ve sent to him a short code that do this.
It really worked.
But we´d like to make this automatic. That when project´s manager insert new
tasks, new projects, the tree of the correspondent tasks already shows in PWA
at MY TASKS view.
Is there a way to do that?
Are we going to the right way?

Thanks

Juliana
 
F

Ferreira, Marco

Hi!
another thing:

do you know the reason why the macro works fine in a project A, for example,
but don't run in a project B, for example?

And another thing:
altough we're using that part of the macro that you indicate to show the
path of the task in the TASKS USAGE view, it didnt work to all projects, just
one.

Regards

Juliana
 

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