Tag: 预约

为什么预约不会偶尔删除

我有一个Excel工作簿中的VBAmacros,用户日历中用特殊标记创buildOutlook约会。 在添加新的约会之前,它首先删除在物品主体中具有该标签的所有约会。 不幸的是,Outlook.AppointmentItem.Delete函数有时不起作用。 当我打开我的Outlook日历时,我可以看到该项目被删除很短的时间,并立即重新出现。 这只是偶尔发生。 我可以通过使用特定标记两次复制AppointmentItem来强制执行此行为。 然后,只有两个约会将被删除,一个保留在日历中。 任何人都可以解释什么可能导致此行为? Public Sub DeleteAppointment(Starttime As Date, Endtime As Date) Dim myStart As Date Dim myEnd As Date Dim olApp As Outlook.Application Dim oCalendar As Outlook.Folder Dim oItems As Outlook.Items Dim oItemsInDateRange As Outlook.Items Dim oAppt As Outlook.AppointmentItem Dim strRestriction As String Dim olNs As Outlook.Namespace Dim blnCreated As […]

方法通过excel在非默认日历中添加约会

我试图添加约会到Outlook通过与VBA的Excel和所有好的时候,我将约会添加到默认日历,但我不知道方法将此约会添加到Outlook中的另一个日历。 下一个代码是默认日历: 子约会() Const olAppointmentItem As Long = 1 Dim OLApp As Object Dim OLNS As Object Dim OLAppointment As Object On Error Resume Next Set OLApp = GetObject(, "Outlook.Application") If OLApp Is Nothing Then Set OLApp = CreateObject("Outlook.Application") On Error GoTo 0 If Not OLApp Is Nothing Then Set OLNS = OLApp.GetNamespace("MAPI") OLNS.Logon Set […]