PropertyType Enumeration

Specifies data type of a document property.

Namespace:  Aspose.Words.Properties
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public enum PropertyType
Members
  Member nameValueDescription
Boolean0 The property is a boolean value.
DateTime1 The property is a date time value.
Double2 The property is a floating number.
Number3 The property is an integer number.
String4 The property is a string value.
StringArray5 The property is an array of strings.
ObjectArray6 The property is an array of objects.
ByteArray7 The property is an array of bytes.
Other8 The property is some other type.
Remarks
Examples
Retrieves the types and values of the custom document properties.
Document doc = new Document(MyDir + "Properties.docx");

foreach (DocumentProperty docProperty in doc.CustomDocumentProperties)
{
    Console.WriteLine(docProperty.Name);
    switch (docProperty.Type)
    {
        case PropertyType.String:
            Console.WriteLine("It's a String value.");
            Console.WriteLine(docProperty.ToString());
            break;
        case PropertyType.Boolean:
            Console.WriteLine("It's a boolean value.");
            Console.WriteLine(docProperty.ToBool());
            break;
        case PropertyType.Number:
            Console.WriteLine("It's an integer value.");
            Console.WriteLine(docProperty.ToInt());
            break;
        case PropertyType.DateTime:
            Console.WriteLine("It's a date time value.");
            Console.WriteLine(docProperty.ToDateTime());
            break;
        case PropertyType.Double:
            Console.WriteLine("It's a double value.");
            Console.WriteLine(docProperty.ToDouble());
            break;
        case PropertyType.Other:
            Console.WriteLine("Other value.");
            break;
        default:
            throw new Exception("Unknown property type.");
    }
}
See Also