Microsoft Project and Inserting Columns

I am doing a LOT of work right now with SAS and Microsoft Project using the Microsoft Project interop, Base SAS, and SAS/IntrNet. One of the client requirements was to add in additional columns to the default MS Project columns. Well, I searched high and low and couldn't figure out how to do it. After some slogging, here is what I came up with:



class MsProjectTest
{
Project p ;
object m = Missing.Value;
string file = @"c:\temp\test.mpp";

public void Process()
{
Application app = new Application();
app.Alerts(false);
p = app.Projects.Add(m,m,m);
Task t = p.Tasks.Add("Test", m);
t.Name = "Test Node";
t.Start = "03/20/2009";
t.Start7 = "03/31/2009";
p.Application.TableEdit("Entry", true, m, m, m, m,
"Start7", "Start Test", 10, PjAlignment.pjLeft,
true, true, 255, 1, 4, 1, m, m);
p.Application.TableApply("Entry");
p.SaveAs(file, PjFileFormat.pjMPP, m, m, m, m,
m, m, m, m, m, m, m, m, m);
app.Quit(PjSaveType.pjDoNotSave);

System.Diagnostics.Process.Start(file);
}
}



I hope this helps some other interop developer out
there struggling with the same issue.

Comments

Popular posts from this blog

DNN Error

SAS XPT Files, IBM Floats, and C#

SAS Deployment Manager and Meadow Muffins