'Set a custom document property.
Args:
name:          The name of the custom property.
value:         The value of the custom property.
property_type: The type of the custom property. Optional.
Returns:
Nothing.'

def set_custom_property(self, name, value, property_type=None):

    if ((name is None) or (value is None)):
        warn('The    name    and    value    parameters    must    be    non-None    in    set_custom_property()')
        return (-1)
    if (property_type is None):
        if isinstance(value, bool):
            property_type = 'bool'
        elif isinstance(value, datetime):
            property_type = 'date'
        elif isinstance(value, int_types):
            property_type = 'number_int'
        elif isinstance(value, num_types):
            property_type = 'number'
        else:
            property_type = 'text'
    if (property_type == 'date'):
        value = value.strftime('%Y-%m-%dT%H:%M:%SZ')
    if ((property_type == 'text') and (len(value) > 255)):
        warn(("Length    of    'value'    parameter    exceeds    Excel's    limit    of    255    characters    in    set_custom_property():    '%s'" % force_unicode(value)))
    if (len(name) > 255):
        warn(("Length    of    'name'    parameter    exceeds    Excel's    limit    of    255    characters    in    set_custom_property():    '%s'" % force_unicode(name)))
    self.custom_properties.append((name, value, property_type))
