public void CustomNamedAccess()
{
//ExStart
//ExFor:DocumentPropertyCollection.Item(String)
//ExFor:CustomDocumentProperties.Add(String,DateTime)
//ExFor:DocumentProperty.ToDateTime
//ExSummary:Retrieves a custom document property by name.
Document doc = new Document(MyDir + "Properties.doc");
DocumentProperty prop = doc.CustomDocumentProperties["Authorized Date"];
if (prop != null)
{
Console.WriteLine(prop.ToDateTime());
}
else
{
Console.WriteLine("The document is not authorized. Authorizing...");
doc.CustomDocumentProperties.Add("AuthorizedDate", DateTime.Now);
}
//ExEnd
}