本文介绍了设置多个前景类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VBScript与Outlook一起使用,以根据某些条件更改电子邮件上的类别.我的问题是我不知道VBScript如何处理与Outlook的交互以分配多个类别.

I'm attempting to work with Outlook using VBScript to change the categories on an email based on certain criteria. My problem is I can't figure out how VBScript handles interacting with Outlook for assigning multiple categories.

Set objOutlook   = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objMailbox   = objNamespace.Folders("team")
Set objFolder = objMailbox.Folders("Inbox").Folders.Item("test")
Set colItems = objFolder.Items
mycount = objFolder.Items.Count

If objItem.Categories = "Purple Category" Then
    objItem.Categories = "Purple Category, Green Category"

但这不起作用.有任何想法吗?

But that isn't working. Any ideas anyone?

推荐答案

类别必须用;"分隔.您还需要保存以下项目:

The categories must be separated with ";". You also need to save the item:

If objItem.Categories = "Purple Category" Then
    objItem.Categories = "Purple Category;Green Category"
    objItem.Save
End If

这篇关于设置多个前景类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 02:26