ApplicationClass.FileOpen

G

GregV

I'm having trouble opening an enterprise project (Server 2003) using C# via
the MSProject object model. It can't open the project. (when I just use the
<>\ it throws an exception - if I put the http:\\machine\projectserver in it
doesn't throw an exception but it returns false and the ActiveProject object
is null. Code as follows:

Microsoft.Office.Interop.MSProject.ApplicationClass app = new
Microsoft.Office.Interop.MSProject.ApplicationClass();

app.FileOpen(@"<http:\\machine\projectserver>\bb.Published", Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
PjPoolOpen.pjPoolReadOnly, Missing.Value, Missing.Value, Missing.Value,
Missing.Value);

1. Where are the parameters documented if anywhere? I'm especially
interested in the UserId, DatabasePassWord, and Password params.
2. Is there another way to open an existing project residing in Project
Server for modification via the COM object model?

The app is running as a desktop so I assume its using the user credentials
for the logged in user which I can use Project Professional just fine.

Thanks
 
R

Rod Gill

Hi,

Try <> without the path. You will need to have Project open and logged onto
Project Server already for it to work.
 
G

GregV

Thanks for your help Rod - the <> without the path or the server link inside
throws an exception. With the server link it doesn't throw an exception but
it returns false and ActiveProject is null. Curiously when I first opened the
project via MSProject and ran my exe it did successfully open the project via
my exe, so thanks for that idea. This was a first for getting it open. This
kind of defeats the purpose of having a separate exe do some work on multiple
projects however. Any other ideas on how to open without involvement of the
user? Something in the principle's credentials who is opening it?

Also whenever I open via my .net exe via COM the next time I open project it
thinks I'm in offline mode. What's up with dat? Where does it store the
"startup in offline/enterprise mode"?

Where are any of the MSProject COM objects/methods documented?
Thanks so much,
Greg
 

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