vba - 获取当前选择的 Outlook 约会
问题描述
我想在 Outlook 中有一个按钮,将所选 Outlook 约会的类别(在日历窗口中)更改为“绿色类别”。
Sub set_to_solved()
Dim objApp As Outlook.Application
Dim citem As Outlook.AppointmentItem
citem.Categories = "Green Category"
End Sub
我在想我没有引用所选项目。
解决方案
首先,您永远不会初始化citem
有价值的东西,其次,您永远不会在设置Categories
属性后保存约会。
dim citem As object
for each citem in Application.ActiveExplorer.Selection
if citem.Class = 26 Then 'olAppointment
citem.Categories = "Green Category"
citem.Save
End If
next
推荐阅读
- python - 如何在 Python 中安排 asyncio 函数?
- javascript - TypeError:无法读取未定义 DISCORD 的属性“通道”
- angularjs - PDFTron 迁移与 Angularjs 问题
- firebase - 如何调查可疑的 Firebase 托管使用情况?
- php - 我如何在 AppServiceProvider 中使用会话而不使用视图作曲家?
- oracle-apex - Oracle Apex IG:无法动态设置 HTML 表达式
- javascript - 此条件在检查假值时返回布尔值,但在检查真值时返回字符串。我怎样才能让它工作?
- mongodb - 如何根据配置创建 Spark 连接 str?
- python - 执行 Pyspark 作业时顶点失败
- android - onMessageReceived(RemoteMessage remoteMessage) 应用程序在后台或被杀死时不调用