首页 > 解决方案 > 日期选择器控件替换在 Outlook 中不起作用

问题描述

我最近被引导到下面的链接以替换日期时间选择器用户窗体控件(它在 64 位 Office 365 中不起作用,即使注册了 MSCOMCT2 等)。谢谢你,它在 excel 中效果很好,这正是我所追求的。

如何在 VBA Excel 中创建日历输入?

但是,当我尝试在 Outlook 用户窗体上运行它时,我收到一个编译错误,告诉我未识别用户定义的类型。违规行是用户表单声明中的“Private Cal_theme As CalendarThemes”。

    Option Explicit

    Private TimerID As Long, TimerSeconds As Single, tim As Boolean
    Dim curDate As Date
    Dim i As Long
    Dim thisDay As Integer, thisMonth As Integer, thisYear As Integer
    Dim CBArray() As New CalendarClass

    Dim NewXpos As Single
    Dim NewYpos As Single

    Private Cal_theme As CalendarThemes
    Private LdtFormat As String, SdtFormat As String

Outlook 中的引用与 Excel 中的引用相同。

我可能错过了一个类似的问题,但在这里找不到答案。有谁知道为什么会这样?

标签: vbaoutlookdatetimepicker

解决方案


推荐阅读