Treb over at Evil Doctor Porkchop (who apparently does not want to link to my blog!) had emailed me about how to do something using VBA in Outlook.  Basically, how could you add a task via outlook to a project (not necessarily projectserver).  So I immediately got back to him a week or 2 later :-).  Here is my kind of answer.  Using some code that Larry Duff had sent, here is how I accomplish modifying tasks, this is in C# (.NET 1.1 framework) though.  VBA would be similar in how this is called, so hopefully this helps out.  Keep in mind that the application references the Microsoft Project Office dll.

private ApplicationClass m_ProjectProApp;

m_ProjectProApp.FileOpen ( "MyProjectName", missingValue, missingValue, missingValue, missingValue,

missingValue, missingValue, missingValue, missingValue,

missingValue, missingValue, PjPoolOpen.pjDoNotOpenPool ,

missingValue, missingValue, missingValue, missingValue);

m_ProjectProApp.ViewApply("All Fields View", missingValue, missingValue);

currTask = m_ProjectProApp.ActiveProject.Tasks.Add( "TaskName", missingValue );

I figure that Treb already got the answer but perhaps this would be helpful to others.

 

Sponsor