P
Phillip D
All I'm trying to do is use automation/c# to open an existing mpp file and
save it in mdb format. The code below opens the mpp file just fine, and the
call to FileSaveAs returns true - however it doesn't actually save the save
in mdb/access format. I must be missing something very obvious, but what?
private void SaveAsMdb()
{
Object oTrue = true;
Object oFalse = false;
string strProject = @"C:\Test\Project.mpp";
string strMdb = @"C:\Test\Access.mdb";
MSProject.ApplicationClass projectApp = new
MSProject.ApplicationClass();
projectApp.Visible = true;
projectApp.FileOpen(strProject, Missing.Value, oFalse,
Missing.Value, Missing.Value,
Missing.Value, oTrue, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value,
Microsoft.Office.Interop.MSProject.PjPoolOpen.pjDoNotOpenPool,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value);
projectApp.FileSaveAs(strMdb,
Microsoft.Office.Interop.MSProject.PjFileFormat.pjMPP,
Missing.Value, Missing.Value, oTrue,
Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, "MSProject.mdb",
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value);
projectApp.Quit(Microsoft.Office.Interop.MSProject.PjSaveType.pjDoNotSave);
}
save it in mdb format. The code below opens the mpp file just fine, and the
call to FileSaveAs returns true - however it doesn't actually save the save
in mdb/access format. I must be missing something very obvious, but what?
private void SaveAsMdb()
{
Object oTrue = true;
Object oFalse = false;
string strProject = @"C:\Test\Project.mpp";
string strMdb = @"C:\Test\Access.mdb";
MSProject.ApplicationClass projectApp = new
MSProject.ApplicationClass();
projectApp.Visible = true;
projectApp.FileOpen(strProject, Missing.Value, oFalse,
Missing.Value, Missing.Value,
Missing.Value, oTrue, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value,
Microsoft.Office.Interop.MSProject.PjPoolOpen.pjDoNotOpenPool,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value);
projectApp.FileSaveAs(strMdb,
Microsoft.Office.Interop.MSProject.PjFileFormat.pjMPP,
Missing.Value, Missing.Value, oTrue,
Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, "MSProject.mdb",
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value, Missing.Value,
Missing.Value);
projectApp.Quit(Microsoft.Office.Interop.MSProject.PjSaveType.pjDoNotSave);
}