Created
August 11, 2013 15:36
-
-
Save felixlindemann/6205388 to your computer and use it in GitHub Desktop.
c# vsto word read customproperty
This file contains 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
private string ReadDocumentProperty(string propertyName) | |
{ | |
Microsoft.Office.Core.DocumentProperties properties; | |
Document doc = this.getDoc(); | |
properties = (Microsoft.Office.Core.DocumentProperties) | |
doc.CustomDocumentProperties; | |
if (properties.Cast<DocumentProperty>().Where(c => c.Name == propertyName).Count() > 0) | |
return properties[propertyName].Value.ToString(); | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment