How get task items in Project Pro 2007?

A

Anton

Hellow!
I try get task items:

MSProject.Application pjApp = new MSProject.Application();
pjApp.FileOpen(@"D:\sample.mpp", Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing,
Type.Missing, Type.Missing, PjPoolOpen.pjPoolReadWrite, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);

for (int i = 1; i < pjApp.ActiveProject.Tasks.Count; i++)
MessageBox.Show(pjApp.ActiveProject.Tasks.Name.ToString());

pjApp.Quit(PjSaveType.pjDoNotSave);

When I run this code I get following error: HRESULT E_FAIL.
When I wrong?
 

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