Last active
July 15, 2021 09:55
-
-
Save aspose-com-kb/2d0fa4aeba0a5ac6a9bc042bc99b4d49 to your computer and use it in GitHub Desktop.
Extract Microsoft Project Metadata Information from .MPP File in C#. The step by step explanation can be found here: https://kb.aspose.com/tasks/net/how-to-extract-microsoft-project-file-metadata-in-c-sharp/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
//Add reference to Aspose.Tasks for .NET API | |
//Use following namespaces to extract metadata from Micorosoft Project file | |
using Aspose.Tasks; | |
namespace ExtractMicrosoftProjectFileMetaData | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//Set Aspose license before extracting metadata from .MPP Project file | |
//using Aspose.Tasks for .NET | |
Aspose.Tasks.License AsposeTasksLicense = new Aspose.Tasks.License(); | |
AsposeTasksLicense.SetLicense(@"c:\asposelicense\license.lic"); | |
//creating an instance of Project class and loading .MPP file to read metadata | |
Project MicrosoftProjectFile = new Project("InputMicrosoftProjectFile.mpp"); | |
//temporary string variables to hold metadata information | |
string ProjectAuthor, | |
ProjectCategory, | |
ProjectCompany, | |
ProjectComments; | |
//get each metadata property by property name as below | |
ProjectAuthor = MicrosoftProjectFile.Get(Prj.Author); | |
ProjectCategory = MicrosoftProjectFile.Get(Prj.Category); | |
ProjectCompany = MicrosoftProjectFile.Get(Prj.Company); | |
ProjectComments = MicrosoftProjectFile.Get(Prj.Comments); | |
//display the metadata information read from the Microsoft Project | |
Console.WriteLine("Author:{0}, Catgory:{1}, Company:{2}, Comments:{3}", | |
ProjectAuthor, ProjectCategory, ProjectCompany, ProjectComments); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment