MSProject2003 : Set a list of resources

B

Bridou

Hello everybody,

First of all, I'm french, so excuse my english ;)

I'm developing a plugin for MSProject 2003 to import tasks from one of our
tool.

I'd like to know if there is a way to fix a list of choosable resources and
to prevent a user from adding another one, only use which are available.

Thanks a lot for your help.
 
J

Jim Aksel

Your English is much better than some who live here in Los Angeles... :)

Since you are already coding, it will be possible for you to examine the
existing resources and the new (imported) resources. You can then create
code to populate a drop box containing only unique resources.

However, have you considered this: Suppose a resource in your file is
"Michele P." and your try to import "Michele". If "Michele P." and "Michele"
are the same person, the code still believes they are different people.

You may find additional information by reading the "Help" for "Resource
Pools"
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 
J

Jan De Messemaeker

Bonjour Bridou,

There is a setting in the options that does not exactly do what you want but
it may help.
Tools, Options, General, Cross out "Automatically add New resources and
tasks"
That way, when a user types a new resource name (for instance) in the
Resource Names field, there will be a warning message - he can still
override that but at least he won't enter one by accident

Another approach is to write a macro comparing the resources of a file to
those of a "reference file" you keep (and to delete the unwanted).

Hope this helps,
 
B

Bridou

Just for information, if it can helps someone else, my solution is :

[
instanceProject is a MSProject.Application
projetActif is a MSProject.Project
projetActif = instanceProject.ActiveProject
]

The solution :

//We open Resource sheet
instanceProject.ViewApply(projetActif.ViewList[10].ToString(),
System.Reflection.Missing.Value, System.Reflection.Missing.Value);

resource_Count = 0;

foreach(string one_Resource in Resource_List)
{
instanceProject.SetResourceField("Name", one_Resource,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
resource_Count, System.Reflection.Missing.Value);

resource_Count++;

}
//Go to Gantt diagram
instanceProject.ViewApply(projetActif.ViewList[1].ToString(),
System.Reflection.Missing.Value, System.Reflection.Missing.Value);

Hope it can help someone.
 

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