GetUserOofSettingsRequest Class

Definition

The GetUserOofSettingsRequest class represents a request to get a user's Out of Office (OOF) settings.

public ref class GetUserOofSettingsRequest : ExchangeWebServices::BaseRequestType
public class GetUserOofSettingsRequest : ExchangeWebServices.BaseRequestType
Public Class GetUserOofSettingsRequest
Inherits BaseRequestType
Inheritance
GetUserOofSettingsRequest

Examples

The following example shows you how to form a GetUserOofSettings request and receive the response.

static void GetOOF(ExchangeServiceBinding esb)
{
    // Create the request.
    GetUserOofSettingsRequest <span class="label">request</span> = new GetUserOofSettingsRequest();
<span class="label">request</span>.Mailbox = new EmailAddress();
<span class="label">request</span>.Mailbox.Address = "someone@example.com";

    try
    {
        // Send the request and get the response.
        GetUserOofSettingsResponse response = esb.GetUserOofSettings(<span class="label">request</span>);
        if (response.ResponseMessage.ResponseClass == ResponseClassType.Success)
        {
            if (response.AllowExternalOofSpecified)
            {
                Console.WriteLine("External OOF enabled for: " + response.AllowExternalOof);
            }

            // Display OOF information.
            Duration dur = response.OofSettings.Duration;
            Console.WriteLine("OOF start time: " + dur.StartTime.ToString());
            Console.WriteLine("OOF end time: " + dur.EndTime.ToString());

            Console.WriteLine("OOF state: " + response.OofSettings.OofState);
            Console.WriteLine("External reply: " + response.OofSettings.ExternalReply.Message);
            Console.WriteLine("Internal reply: " + response.OofSettings.InternalReply.Message);
        }
    }
    catch (Exception e)
    { 
        Console.WriteLine(e.Message); 
    }
}

Remarks

If the OOF message is set by Microsoft Office Outlook, this operation will return the OOF message in HTML format.

Constructors

GetUserOofSettingsRequest()

The GetUserOofSettingsRequest constructor initializes a new instance of the GetUserOofSettingsRequest class.

Properties

Mailbox

The Mailbox property gets or sets the mailbox user whose OOF settings are returned. This property is required. This is a read/write property.

Applies to