How to get MS Project start and end dates
Retrieving project start/end dates
GroupDocs.Viewer provides additional information such as project start and end dates for MS Project documents when calling GetViewInfo method. To retrieve view information for MS Project document call GetViewInfo method and cast output result to ProjectManagementViewInfo type.
Following example demonstrates how to retrieve view information for MS Project document.
using (Viewer viewer = new Viewer("sample.mpp"))
{
ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForHtmlView();
ProjectManagementViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions) as ProjectManagementViewInfo;
Console.WriteLine("Document type is: " + viewInfo.FileType);
Console.WriteLine("Pages count: " + viewInfo.Pages.Count);
Console.WriteLine("Project start date: {0}", viewInfo.StartDate);
Console.WriteLine("Project end date: {0}", viewInfo.EndDate);
}
More resources
View MS Project Files Online
Along with full-featured .NET library we provide simple but powerful free online Apps. View MS Project MPP, MPT, and MPX files online with GroupDocs Viewer App.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for .NET examples, plugins, and showcase
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET MVC UI Example
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example