未在Excel中为AppointmentItem定义的用户定义类型 [英] User-defined type not defined for AppointmentItem in Excel

查看:58
本文介绍了未在Excel中为AppointmentItem定义的用户定义类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆