在选择上使用 VBA 设置类别在 Outlook 2007 中似乎不起作用 [英] Setting categories using VBA on a selection does not seem to work in Outlook 2007

查看:51
本文介绍了在选择上使用 VBA 设置类别在 Outlook 2007 中似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为当前选择设置邮件消息类别.当我运行宏时,我最终只会将一条消息设置为给定的类别.我使用以下代码(并且还尝试使用 selection.count 使用 do until..loop):

I'm trying to set the mail message categories for the current selection. When I run the macro I end up in only a single message being set to the given categorie. I Use the following code (and have also tried to use a do until..loop using the selection.count):

Sub SetSelectionComplete()
    Dim mailMsg As MailItem

    For Each mailMsg In Outlook.Application.ActiveExplorer.Selection
        mailMsg.Categories = "Complete"
    Next

End Sub

有什么想法吗?

推荐答案

每次都保存ma​​ilMsg项,像这样:

Save the mailMsg item each time, like this:

Sub SetSelectionComplete()
    Dim mailMsg As MailItem
    For Each mailMsg In Outlook.Application.ActiveExplorer.Selection
        mailMsg.Categories = "Complete"
        mailMsg.Save
    Next
End Sub

这篇关于在选择上使用 VBA 设置类别在 Outlook 2007 中似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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