0

こんにちは、カレンダーの招待状を他のメンバーに送信したいのですが、vb.net でそれを行うにはどうすればよいですか。exchange webreference を追加し、通常のメールを他の人に送信できます。

これが私がこれまでに持っているものです

   Public Sub Einladungen()
        Dim esb As New ExchangeServer.ExchangeServiceBinding
        esb.Credentials = New NetworkCredential(Session("EX_UserName").ToString, Session("EX_Password").ToString)
        esb.Url = Session("EX_DomainURL")

        Dim appointment As CalendarItemType = New CalendarItemType

        ' Set properties on the appointment.
        appointment.Subject = "Dentist Appointment"
        appointment.Body = New BodyType
        appointment.Body.BodyType1 = BodyTypeType.Text
        appointment.Body.Value = "Agenda Items...."
        appointment.Start = New DateTime(2012, 3, 1, 9, 0, 0)
        appointment.End = appointment.Start.AddHours(2)

        appointment.Location = "Conf Room"
        appointment.RequiredAttendees.Add("user1@contoso.com")
        appointment.RequiredAttendees.Add("user2@contoso.com")
        appointment.OptionalAttendees.Add("user3@contoso.com")
        ' Save the appointment.
        appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy)
    End Sub

Visual Studio は次のことを教えてくれます。

Add は「System.Array」のメンバーではありません

「保存」は「ExchangeServer.CalendarItemType」のメンバーではありません

「SendInvitationMode」という名前が宣言されていません

私は何が欠けていますか?

よろしくお願いいたします。

4

1 に答える 1

1

問題は、Exchange Web サービスを直接参照して独自の EWS プロキシ クラスを作成したが、見つけたサンプル コードがExchange Web サービス マネージ APIを使用して構築されていることです。

したがって、EWS マネージ API をダウンロードし、 Microsoft.Exchange.WebServices.dll への参照を追加し、コードの先頭を次のように変更する必要があります。

Dim esb As New ExchangeService(ExchangeVersion.Exchange2007_SP1);
esb.Credentials = New NetworkCredential(Session("EX_UserName").ToString, Session("EX_Password").ToString)
esb.Url = Session("EX_DomainURL")

Dim appointment As new Appointment(esb);
// ... the rest of your code here.

次の例をご覧ください: http://msdn.microsoft.com/en-us/library/exchange/dd633661(v=exchg.80).aspx

于 2012-10-03T12:10:39.010 に答える