Opening a file in 2007

M

Mr Exxxel

I have a application that start MS Project and opens a .mpp file. It worked
great in MSP2003:
MS Project loded ...
a blank project ("Project1") opens....
and then when I open my project the default project closes.

When I run my app with MS Project 2007 the default project does not close!
Is there any way to check if the active project is created by a user or by
project itself? I dont want to close a project thats been created by a user
and make them loose any data!
 
J

Jan De Messemaeker

Hi,

You could try
if lcase(left(activeproject.name,7))="project" then
Or if activeproject.tasks.count=0 then
Hope this helps
 
A

Adam Behrle

A stronger option is to make sure the file isn't dirty and that it
hasn't been saved at some point:

If ActiveProject.Saved And ActiveProject.Path = "" Then
'Project is default
End If

If a user adds a resource or task, saved = false. If they open a file
withouth making any mods, Path will be non empty. You should also
check the type on the project to make sure it's not a global (resource
global will return an empty path, at least in Proj2003).

Hope this helps.

Adam Behrle
QuantumPM
 

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