Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find current version of project

Status
Not open for further replies.

markbeeson

Programmer
Jun 14, 2003
19
NZ
Newbie and MS Project macros here - Does anyone know how to find the current saved version of a project?
I'm trying to write a macro that opens up a project, does some changes and then saves it back to the same saved version but I can't see how to tell my macro what the original saved version of the project.

I'm only working with version 8 and 9. Thanks
 
Project file version numbers are not available.

(I'm not sure why you'd want to go back to the original saved version. Surely you want to go to the most recently saved version but perhaps you have unique requirements.)

I presume that by "version 8 and 9" you mean version 8 and 9 of project. If so, you should be aware that moving from P98 (version 8) to P2000 (version 9) brings in significant enhancements to the Project object model. I would concentrate on getting your macro to work in P98 since P98 -> P2000 is _generally_ upwardly compatible but developing the code for P2000 and then trying to get it to work with P98 is likely to present challenges.
 
Thanks for that. Our reason is that we are running over 200 projects and every week they all email their project files in for analysis.

We run a macro and change some information and then save the project file and email it back to the project manager.

The problem is that some PM's are using 98 and others are using 2000. We want our macro to open up the project file, do our changes and then save it back to the same version.

I understand this may not be possible but thanks for your advice. Cheers.
 
Ah, but there might be a way to do what you want.

Look at activeproject.builtindocumentproperties

First do this:

for i=1to30
debug.print activeproject.builtindocumentproperties(i).name
next

That will tell you the project fields you can use.

Now, just set one of those (I tested it with Revision number) to "98" or "2000" and hope that nobody messes with it.


In your vba you can reference by either

activeproject.builtindocumentproperties(8).value or
activeproject.builtindocumentproperties("Revision number").value

The first is faster; the second is more readable.

I did find some "gotchas" using fields above 9 (or was it 10?) and I didn't try it on P2000. You'll want to test it a bit.

Report back with your experiences.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top