【发布时间】:2012-09-20 06:02:16
【问题描述】:
您好,我想向其他成员发送日历邀请,我如何在 vb.net 中做到这一点, 我添加了交换网络参考,可以向其他人发送普通邮件。
这是我目前所拥有的
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”未声明
我错过了什么?
提前感谢您的帮助
【问题讨论】:
-
关于.Add 不是会员。您将需要创建一个新的 RequiredAttendee 对象并添加它,而不仅仅是您要参加的电子邮件字符串,因为这不起作用。
标签: asp.net vb.net visual-studio-2008 exchangewebservices