ForwardItemType Class

The ForwardItemType class represents a forward item response object that is used to forward meeting messages to another recipient.

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

Syntax

'Declaration
<SerializableAttribute> _
<GeneratedCodeAttribute("wsdl", "2.0.50727.42")> _
<XmlTypeAttribute(Namespace:="https://schemas.microsoft.com/exchange/services/2006/types")> _
<DesignerCategoryAttribute("code")> _
<DebuggerStepThroughAttribute> _
Public Class ForwardItemType
    Inherits SmartResponseType
[SerializableAttribute] 
[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
[XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types")] 
[DesignerCategoryAttribute("code")] 
[DebuggerStepThroughAttribute] 
public class ForwardItemType : SmartResponseType
[SerializableAttribute] 
[GeneratedCodeAttribute(L"wsdl", L"2.0.50727.42")] 
[XmlTypeAttribute(Namespace=L"https://schemas.microsoft.com/exchange/services/2006/types")] 
[DesignerCategoryAttribute(L"code")] 
[DebuggerStepThroughAttribute] 
public ref class ForwardItemType : public SmartResponseType
/** @attribute SerializableAttribute() */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types") */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
public class ForwardItemType extends SmartResponseType
SerializableAttribute 
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types") 
DesignerCategoryAttribute("code") 
DebuggerStepThroughAttribute 
public class ForwardItemType extends SmartResponseType

Remarks

The ReferenceItemId property must be set on the ForwardItemType object to identify the meeting message that is forwarded. ToRecipients, CcRecipients, or BccRecipients must be set to the recipients of the forwarded meeting message. One recipient must be set if the message is sent. You do not have to set a recipient if the message disposition is to save.

The following are the only properties that are valid for the ForwardItemType:

Inheritance Hierarchy

System.Object
   ExchangeWebServices.ItemType
     ExchangeWebServices.MessageType
       ExchangeWebServices.ResponseObjectCoreType
         ExchangeWebServices.ResponseObjectType
           ExchangeWebServices.SmartResponseBaseType
             ExchangeWebServices.SmartResponseType
              ExchangeWebServices.ForwardItemType

Example

The following example shows you how to forward a meeting request to a single recipient and add content to the message body. The item identifier of the meeting request is used in the ReferenceItemId property.

static void ForwardItem(ExchangeServiceBinding esb)
{
    // Create the request.
    CreateItemType request = new CreateItemType();

    // Set the message disposition on the request.
    request.MessageDisposition = MessageDispositionType.SendAndSaveCopy;
    request.MessageDispositionSpecified = true;
    
    // Create the ForwardItem response object.
    ForwardItemType forwardItem = new ForwardItemType();
    forwardItem.ToRecipients = new EmailAddressType[1];
    forwardItem.ToRecipients[0] = new EmailAddressType();
    forwardItem.ToRecipients[0].EmailAddress=  "someone@example.com";
    forwardItem.NewBodyContent = new BodyType();
    forwardItem.NewBodyContent.BodyType1 = BodyTypeType.Text;
    forwardItem.NewBodyContent.Value = "You may want to attend this meeting.";

    // Identify the meeting request to forward.
    forwardItem.ReferenceItemId = new ItemIdType();
    forwardItem.ReferenceItemId.Id = "AAArAG1za2lubmVyQG1haW5lcmNvbnRvc28";
    forwardItem.ReferenceItemId.ChangeKey = "CwAAABYAAAAMoHzy8/QATr21q";

    // Add the ForwardItem response object to the request.
    request.Items = new NonEmptyArrayOfAllItemsType();
    request.Items.Items = new ItemType[1];
    request.Items.Items[0] = forwardItem;

    // Send the request and get the response.
    CreateItemResponseType response = esb.CreateItem(request);

    ArrayOfResponseMessagesType aormt = response.ResponseMessages;
    ResponseMessageType[] rmta = aormt.Items;

    foreach (ResponseMessageType rmt in rmta)
    {
        ItemInfoResponseMessageType iirmt = (rmt as ItemInfoResponseMessageType);
        if (iirmt.ResponseClass == ResponseClassType.Success)
        {
            Console.WriteLine("Successfully forwarded meeting.");
        }
    }
}

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.

Platforms

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)