OutlookUserPropertyCollection
OfficeIMO.Email
Outlook-compatible user-defined fields backed by PidLidPropertyDefinitionStream and string-named PS_PUBLIC_STRINGS values.
Inheritance
- object
- OutlookUserPropertyCollection
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property EmailDocument.UserProperties
Methods
public OutlookUserProperty? Find(string name) #Finds a user property case-insensitively.
Parameters
- name string
Returns
OutlookUserProperty?public IEnumerator<OutlookUserProperty> GetEnumerator() #Returns an enumerator that iterates through the collection.
Returns
IEnumerator<OutlookUserProperty> An enumerator that can be used to iterate through the collection.public T? GetValueOrDefault<T>(string name) #Reads a typed value or returns the managed default when it is absent or incompatible.
Type Parameters
- T
Parameters
- name string
Returns
T?public bool Remove(string name) #Removes the named value and its custom field definition.
Parameters
- name string
Returns
bool True when either a value or definition was removed.public OutlookUserProperty Set(string name, object value) #Creates or replaces a user property, inferring its Outlook field type.
Parameters
- name string
- value object
Returns
OutlookUserPropertypublic OutlookUserProperty Set(string name, object value, OutlookUserPropertyType fieldType, bool allowTypeChange = false) #Creates or replaces a user property and its Outlook field definition. Existing definitions cannot be changed to a different known type unless allowTypeChange is true.
Parameters
- name string
- value object
- fieldType OfficeIMO.Email.OutlookUserPropertyType
- allowTypeChange bool = false
Returns
OutlookUserPropertypublic OutlookUserProperty SetDuration(string name, TimeSpan value, bool allowTypeChange = false) #Creates or replaces a duration field using its natural managed representation.
Parameters
- name string
- value System.TimeSpan
- allowTypeChange bool = false
Returns
OutlookUserPropertypublic OutlookUserProperty SetKeywords(string name, IEnumerable<string> values, bool allowTypeChange = false) #Creates or replaces a multiple-string keyword field.
Parameters
- name string
- values System.Collections.Generic.IEnumerable<string>
- allowTypeChange bool = false
Returns
OutlookUserPropertypublic bool TryGetValue<T>(string name, out T? value) #Attempts to read and convert a user property's value.
Type Parameters
- T
Parameters
- name string
- value T?
Returns
boolInherited Methods
Properties
public OutlookUserPropertyDefinitionState DefinitionState { get; } #State of the item's complete field-definition stream.
public string? DefinitionError { get; } #Parse error for a corrupt or unsupported definition stream.
public IReadOnlyList<OutlookUserPropertyDefinition> Definitions { get; } #Every decoded field definition, including preserved built-in bindings.
public int Count { get; } #Gets the number of elements in the collection.