在这个 excel VBA 代码中,我试图在 Outlook 中创建一个新约会,我想要通过电子邮件发送那个约会,即我想邀请用户进行约会。
我不确定我是否需要为这个东西创建一个新的 outlook.recipients 对象,或者我没有正确使用 .Recipeint.Add 属性。
Sub app()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.AppointmentItem
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(olAppointmentItem)
With OutMail
.Location = " happening"
.Subject = " Event check "
.Start = "8:00 PM" & Format(Date)
.End = "9:00 PM" & Format(Date)
.Body = "this is event details"
.Recipients.Add ("someone@gmail.com") ' This line is not working
' .Display
.Send
End With
End Sub
我将应用程序定义或对象定义为错误。提前致谢。