首页 > 解决方案 > 如何在 Outlook 自定义表单上检测周末?

问题描述

我说的是 Outlook 自定义表单,而不是 VBA 用户表单。

我使用 olkdatecontrol 工具作为日期选择器。有没有办法使用这个工具检测周末?

我尝试了以下。

Sub cmdbutTest_Click
    getdate = Item.UserProperties.Find("Start").Value
    
    If(getdate = vbSunday or vbSaturday)then
        MsgBox "Date may not start on the weekend"  
    End If

End Sub

标签: vbaoutlookoutlook-form

解决方案


这个对我有用。从https://stackoverflow.com/a/33115260/10711853得到这个

MsgBox Weekday(MyDate, vbMonday) > 5

推荐阅读