Export (0) Print
Expand All

GetUserOofSettingsRequest Class

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

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

[SerializableAttribute] 
[XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages")] 
[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
[DebuggerStepThroughAttribute] 
[DesignerCategoryAttribute("code")] 
public class GetUserOofSettingsRequest : BaseRequestType
/** @attribute SerializableAttribute() */ 
/** @attribute XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages") */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
/** @attribute DesignerCategoryAttribute("code") */ 
public class GetUserOofSettingsRequest extends BaseRequestType
SerializableAttribute 
XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages") 
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
DebuggerStepThroughAttribute 
DesignerCategoryAttribute("code") 
public class GetUserOofSettingsRequest extends BaseRequestType

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


System.Object
   ExchangeWebServices.BaseRequestType
    ExchangeWebServices.GetUserOofSettingsRequest

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 = "someone@example.com";

    try
    {
        // 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)
    { 
        Console.WriteLine(e.Message); 
    }
}

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

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Longhorn, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2)
Show:
© 2014 Microsoft