Accessing Inserted Project Info

S

snkharvi

Hi All,
I am developing an addin to MS Project. The addin collects active
project info from MS Project and creates XML.
My question is when a project is inserted(with link option) in
another project, how to access following info of a inserted project? I
need to collect info of
1. Project Summary Info
2. Tasks
3. Resources
4. Resources Assignments

I want to collect these info without opening the inserted project
separately.
I see that when we say Save As ".xml" in MS Project, MS Project saves
all these info without opening the inserted project separately.

Thanks in advance,
 
J

John

Hi All,
I am developing an addin to MS Project. The addin collects active
project info from MS Project and creates XML.
My question is when a project is inserted(with link option) in
another project, how to access following info of a inserted project? I
need to collect info of
1. Project Summary Info
2. Tasks
3. Resources
4. Resources Assignments

I want to collect these info without opening the inserted project
separately.
I see that when we say Save As ".xml" in MS Project, MS Project saves
all these info without opening the inserted project separately.

Thanks in advance,

snkharvi,
When you say, "... inserted (with link option)...", I hope you mean
Insert/Project and not Insert/Hyperlink or Edit/Paste Special. The
former will provide a pointer in the master project to each individual
subproject. The latter two will set up a direct link that is very prone
to corruption.

As far as obtaining the subproject information you want, the insertion
point summary line in the master project provides an all up summary of
that subproject. For the other items on your list, the following general
syntax should get you started.

ActiveProject.Subprojects(1).SourceProject.Tasks(1).[property]
or
ActiveProject.Subprojects(1).SourceProject.Resources(1).[property]

The assignments for either construct follows the same general syntax.

Hope this helps.
John
Project MVP
 
J

Jim Aksel

This approach may also be helpful. Rod has shown you how to directly access
a specific subproject by use of the inserted file index.

What I do is make the assumption that I may have more than one inserted
project and I iterate through each of the subprojects.

If ActiveProject.Subprojects.Count < 1 Then
'base case do nothing, tell the user something....
Exit Sub
Else
dim sProject as Subproject
dim bProject as Project
For Each sProject In ActiveProject.Subprojects
Set bProject = sProject.SourceProject
'Code here for anything you want to do... I usually call
functions/subroutines
Next sProject
End If


--
If this post was helpful, please consider rating it.

Jim

Check out my new blog for more information:
http://www.msprojectblog.com
 
J

John

Jim Aksel said:
This approach may also be helpful. Rod has shown you how to directly access
a specific subproject by use of the inserted file index.

What I do is make the assumption that I may have more than one inserted
project and I iterate through each of the subprojects.

If ActiveProject.Subprojects.Count < 1 Then
'base case do nothing, tell the user something....
Exit Sub
Else
dim sProject as Subproject
dim bProject as Project
For Each sProject In ActiveProject.Subprojects
Set bProject = sProject.SourceProject
'Code here for anything you want to do... I usually call
functions/subroutines
Next sProject
End If


--
If this post was helpful, please consider rating it.

Jim

Check out my new blog for more information:
http://www.msprojectblog.com
Jim,
Rod?

John
 

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