BuiltInDocumentPropertiesCompany Property |
Namespace: Aspose.Words.Properties
// Open a document Document doc = new Document(MyDir + "Properties.docx"); // The properties we will work with are members of the BuiltInDocumentProperties attribute BuiltInDocumentProperties properties = doc.BuiltInDocumentProperties; // Since this document has been edited and printed in the past, values generated by Microsoft Word will appear here // These values can be glanced at by right clicking the file in Windows Explorer, without actually opening the document // Fields such as PRINTDATE, EDITTIME etc. can display these values inside the document Console.WriteLine($"Created using {properties.NameOfApplication}, on {properties.CreatedTime}"); Console.WriteLine($"Minutes spent editing: {properties.TotalEditingTime}"); Console.WriteLine($"Date/time last printed: {properties.LastPrinted}"); Console.WriteLine($"Template document: {properties.Template}"); // We can set these properties ourselves properties.Company = "Doe Ltd."; properties.Manager = "Jane Doe"; properties.Version = 5; properties.RevisionNumber++; // If we plan on programmatically saving the document, we may record some details like this properties.LastSavedBy = "John Doe"; properties.LastSavedTime = DateTime.Now; // When right clicking the document file in Windows Explorer, these properties are found in Properties > Details > Origin doc.Save(ArtifactsDir + "Properties.Origin.docx");