You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Outlook桌面版文件夹视图主题旁添加可编辑自定义字段

在Outlook桌面版添加可编辑自定义字段到文件夹视图

一、创建自定义字段

  • 右键目标文件夹 → 属性 → 切换到字段选项卡
  • 点击新建,在弹窗中配置:
    • 名称:输入你的自定义字段名(如自定义备注)
    • 类型:选择文本(支持手动输入内容)
    • 点击确定后,再点击添加将字段加入文件夹可用字段列表,最后确认保存

二、调整视图显示自定义字段

  • 进入目标文件夹,点击顶部视图选项卡 → 视图设置
  • 在弹窗中点击列
  • 在可用列中找到刚创建的自定义字段,选中后点击添加,拖动调整它的位置到主题字段旁,确认保存视图设置

三、用VBA操作自定义字段(适配你的Excel VBA经验)

按Alt + F11打开Outlook VBA编辑器,插入模块后使用以下代码:

单封邮件设置字段值

Sub SetCustomFieldForSingleMail()
    Dim objMail As MailItem
    Dim customFieldName As String
    
    customFieldName = "自定义备注" ' 替换为你的字段名
    
    ' 获取当前选中的邮件
    Set objMail = Application.ActiveExplorer.Selection.Item(1)
    
    ' 创建并设置字段值
    objMail.UserProperties.Add customFieldName, olText
    objMail.UserProperties(customFieldName).Value = "输入你的文本内容"
    objMail.Save ' 必须保存才会生效
End Sub

批量设置文件夹内邮件字段值

Sub BatchSetCustomField()
    Dim objFolder As Folder
    Dim objMail As MailItem
    Dim customFieldName As String
    Dim inputText As String
    
    customFieldName = "自定义备注"
    inputText = InputBox("请输入批量设置的文本:")
    
    ' 获取当前选中的文件夹
    Set objFolder = Application.ActiveExplorer.CurrentFolder
    
    ' 遍历所有邮件项
    For Each objMail In objFolder.Items
        If TypeName(objMail) = "MailItem" Then
            ' 检查字段是否存在,不存在则创建
            On Error Resume Next
            Dim prop As UserProperty
            Set prop = objMail.UserProperties(customFieldName)
            On Error GoTo 0
            
            If prop Is Nothing Then
                Set prop = objMail.UserProperties.Add(customFieldName, olText)
            End If
            
            prop.Value = inputText
            objMail.Save
        End If
    Next objMail
    
    MsgBox "批量设置完成!"
End Sub

代码说明

  • UserProperties.Add用于创建自定义字段,olText对应文本类型
  • 所有修改必须调用Save方法才能永久保存到邮件
  • 批量处理时判断TypeName是为了跳过非邮件项(如会议邀请)

另外,若要直接在视图中编辑字段,确保当前视图为表格视图,且自定义字段的编辑类型为可编辑(在字段属性中确认),即可双击视图单元格直接输入内容。

内容的提问来源于stack exchange,提问作者Mario Di Noia

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 17:25:00