Created
December 15, 2015 13:13
-
-
Save jevo/d30855ed97e25eeaf3bf to your computer and use it in GitHub Desktop.
VSTO PowerPoint 2013 load BuildInDocumentProperties
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
/** | |
* this is only a snippet and it will cause errors during the compiling | |
* For more information see | |
* https://msdn.microsoft.com/en-us/library/microsoft.office.core.documentproperty.aspx | |
/ | |
// put this into using area | |
using Office = Microsoft.Office.Core; | |
// the following code has to be add into a function | |
# region get/set property value for subject | |
Presentation pres = Globals.PowerPointInterpreterAddIn.Application.ActivePresentation; | |
Office.DocumentProperties properties = (Office.DocumentProperties)pres.BuiltInDocumentProperties; //get all properties | |
Office.DocumentProperty prop = properties["Subject"]; // get subject of presentation | |
// if properties is empty add subject text | |
if (prop.Value == null || prop.Value.ToString() == String.Empty) | |
{ | |
// set the value of the property | |
prop.Value = getSubject(); //ToDo implement function getSubject() | |
} | |
// save presentation is necessary to keep the set subject | |
pres.Save | |
# endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment