Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OutlookUserPropertyCollection

OfficeIMO.Email

Namespace
OfficeIMO.Email
Assembly
OfficeIMO.Email
Source revision
d21ee0216bf2 with working tree changes
Implements
IReadOnlyCollection<OutlookUserProperty> IEnumerable<OutlookUserProperty> IEnumerable
Modifiers
sealed

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

Methods

public OutlookUserProperty? Find(string name) #

Finds a user property case-insensitively.

Parameters

name string required
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 required

Returns

T?
public bool Remove(string name) #

Removes the named value and its custom field definition.

Parameters

name string required

Returns

bool True when either a value or definition was removed.
Set 2 overloads
public OutlookUserProperty Set(string name, object value) #

Creates or replaces a user property, inferring its Outlook field type.

Parameters

name string required
value object required
public 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 required
value object required
fieldType OfficeIMO.Email.OutlookUserPropertyType required
allowTypeChange bool = false optional
public OutlookUserProperty SetDuration(string name, TimeSpan value, bool allowTypeChange = false) #

Creates or replaces a duration field using its natural managed representation.

Parameters

name string required
value System.TimeSpan required
allowTypeChange bool = false optional
public OutlookUserProperty SetKeywords(string name, IEnumerable<string> values, bool allowTypeChange = false) #

Creates or replaces a multiple-string keyword field.

Parameters

name string required
values System.Collections.Generic.IEnumerable<string> required
allowTypeChange bool = false optional
public bool TryGetValue<T>(string name, out T? value) #

Attempts to read and convert a user property's value.

Type Parameters

T

Parameters

name string required
value T? required

Returns

bool

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.