excel - 编译错误“未定义用户定义类型”
问题描述
我有以下 ReplyAll 邮件代码,在运行此代码期间,我遇到以下错误:
编译错误 - 未定义用户定义类型
我已在下面粘贴代码并尝试运行此代码,但如上所述出现编译错误。
Sub Test()
Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
i = 1
For Each olMail In Fldr.Items
If InStr(olMail.Subject, "Application for Privilege Leave - Leave ID - Dev-PL-45252-4") <> 0 Then
olMail.Display
i = i + 1
End If
Next olMail
End Sub
从excel回复到outlook-mail- 我希望这个宏运行没有任何错误。
解决方案
推荐阅读
- sharepoint - 角色、角色服务或功能名称无效:“InkandHandwritingServices”。找不到名称 Office Online Server
- elasticsearch-5 - 使用 Java 进行 ElasticSearch 聚合
- javascript - Bash 字符串替换函数类似于 Javascript String.prototype.replace()
- php - 获取所有标题的问题
- android - 在我的 android 项目中添加打开的 CV 创建模型
- qt - 从 QML 中访问应用程序版本
- scala - scala 前向参考扩展了值数据帧的定义
- ios - 无法取消对 Twitter 会话的授权
- bash - 如何过滤来自 speedtest-cli Linux 的 URL
- excel - 使用 Excel 宏打开任何文件