GetUserOofSettingsRequest Class

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

Inheritance Hierarchy


Namespace:  ExchangeWebServices
Assembly:  EWS (in EWS.dll)


<SerializableAttribute> _
Public Class GetUserOofSettingsRequest _
    Inherits BaseRequestType
Dim instance As GetUserOofSettingsRequest
public class GetUserOofSettingsRequest : BaseRequestType


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


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

static void GetOOF(ExchangeServiceBinding esb)
    // Create the request.
    GetUserOofSettingsRequest request = new GetUserOofSettingsRequest();
    request.Mailbox = new EmailAddress();
    request.Mailbox.Address = "";

        // Send the request and get the response.
        GetUserOofSettingsResponse response = esb.GetUserOofSettings(request);
        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)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.