Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails
#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll" rename("RGB", "MSRGB") #import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" raw_interfaces_only, rename("Reference", "ignorethis"), rename("VBE", "testVBE") #import "C:\Program Files\Microsoft Office\OFFICE12\MSPRJ.OLB" auto_search exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox", "ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText", "EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText", "EFindText"), rename("NoPrompt", "ENoPrompt") //Here is the code to automate Project: MSProject::_MSProjectPtr app(__uuidof(MSProject::Application)); //project opens when this line is called if it wasn't open already MSProject::_IProjectDocPtr project; MSProject::TasksPtr tasks; MSProject::TaskPtr task; app->PutVisible(-1); //prj is already visible, but if I set this to 0, it hides, it so I am successfully talking to prj project = app->GetActiveProject(); //project is nonzero after this call long x = project->GetNumberOfTasks(); //this returns 3 which is correct!! tasks = project->GetTasks(); //tasks is nonzero after this call x = tasks->Count; //exception is thrown here. I have also tried tasks->GetCount() and tasks->get_Count(&x) All of which result in the same error //Also, this produces an error as well: //task = tasks->GetItem(0); //Error: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!