0
我试图抓住最后一周在Outlook中使用VBA的约会。限制搜索约会的最后一周
我正在使用.Restrict方法,但是有些东西让我的字符串在3年前被抢回。
我开始通过声明格式的日期对我的时间支架:
myStart = Format(DateAdd("d", -7, Now()), "ddddd h:nn AMPM")
myEnd = Format(Now(), "ddddd h:nn AMPM")
我建立一个字符串来保存我的限制标准。
strRestriction = "[Start] <= '" & myEnd _
& "' AND [End] >= '" & myStart & "'"
最后,我呼吁限制对我的任命事项:
Set oRestrItems = oItems.Restrict(strRestriction)
对于多一点而言,这里是我如何使用/调用结果:
For Each oApptItem In oRestrItems 'oItems will grab everything, but that's hardly perfect.
If oApptItem.Sensitivity <> olPrivate Then
MsgBox (oApptItem.Subject)
MsgBox (oApptItem.Start)
MsgBox (oApptItem.End)
End If
Next
如果您更容易为响应者提供帮助,获得响应的机会更大。 http://stackoverflow.com/help/mcve – niton