未在Excel中为AppointmentItem定义的用户定义类型 [英] User-defined type not defined for AppointmentItem in Excel
问题描述
我在 http://support.microsoft.com/kb/220595 复制了示例到Excel中的VBA.
I copied example at http://support.microsoft.com/kb/220595 to the VBA in Excel.
我的代码如下:
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olAppt As Outlook.AppointmentItem
Set olAppt = olApp.CreateItem(olAppointmentItem)
我在Dim olAppt As Outlook.AppointmentItem
行上获得了以下错误:
未定义用户定义的类型".
I obtained the following error on the line Dim olAppt As Outlook.AppointmentItem
:
"User-defined type not defined".
应该如何解决?
我使用MS Office 2003.
I use MS Office 2003.
推荐答案
该文章中列出了四个必备步骤.它们在代码块的前面列出.
There are four prerequisite steps listed in that article. They are listed right before the code block.
您可能忘记了第二步,添加对Outlook对象库的引用.
唯一的区别是,在VBA中,菜单项位于Tools
下,而不是Project
下.
You probably forgot to follow the step two, Adding a reference to Outlook object library.
The only difference is, in VBA the menu item is under Tools
, not Project
.
这篇关于未在Excel中为AppointmentItem定义的用户定义类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!