如何在 Mac 版 MS Word 中更改注释的作者?

如何在 Mac 版 MS Word 中更改注释的作者?

是否可以更改或隐藏文档评论作者的姓名?我有数百份文档,其中我写了数十条评论,现在我的老板希望我将评论者姓名从我改为他。这可行吗,还是我必须手动复制粘贴所有评论?

答案1

删除(不更改)用户名遵循本指南

On the Word menu, click Preferences.

Under Personal Settings, click Security.
Under Privacy options, select the Remove personal information from this file on save check box.
Save the document.

否则,这个问题的答案将需要大量的手动工作:如何在 Word 中更改审阅者的姓名?

答案2

由于 Word for Mac 2011 支持宏,您应该能够通过将所有文档放在一个文件夹中并运行以下代码来实现此自动执行。

将 vDirectory 更改为包含要修改的文档的文件夹的路径。sAuthorName 变量应包含替换名称。所需的函数GetFilesOnMacWithOrWithoutSubfolders可以在网上找到这里

免责声明:此宏尚未在 MAC 上测试过

Sub ChangeAuthorInDocumentComments ()
Dim vDirectory As String
Dim sAuthorName As String
Dim oDoc As Document

vDirectory = "C:\Docs\"
sAuthorName = "Adam"
MyFiles = ""

Call GetFilesOnMacWithOrWithoutSubfolders(Level:=1, ExtChoice:=7, FileFilterOption:=3, FileNameFilterStr:=".doc")

Application.ScreenUpdating = False

If MyFiles <> "" Then

    MySplit = Split(MyFiles, Chr(10))
    For FileInMyFiles = LBound(MySplit) To UBound(MySplit) - 1

        Set oDoc = Documents.Open(MySplit(FileInMyFiles))

        For Each Ocom In ActiveDocument.Comments
             With Ocom
                 Ocom.Author = sAuthorName
             End With
        Next

    oDoc.Close SaveChanges:=True
    Next FileInMyFiles
 End If

 Application.ScreenUpdating = True
End Sub

答案3

在 Windows 11/Microsoft Office 2021 上:

  1. 打开文档
  2. 转到“文件”>“选项”>“信任中心”>“信任中心设置”>“隐私选项”。取消选中“保存时从文件属性中删除个人信息”,然后单击“确定”。
  3. 打开 Visual Basic 编辑器 (Alt+F11),然后双击左侧项目面板中的“此文档”。
  4. 将以下代码粘贴到脚本编辑器中:
Sub ChangeAllAuthorNamesInComments()
  Dim objComment As Comment

  ' Change all author names in comments
  For Each objComment In ActiveDocument.Comments
    objComment.Author = "XYZ"
    objComment.Initial = "X"
  Next objComment
End Sub
  1. 运行脚本(F5)。
  2. 确认评论的作者姓名已更新,然后保存文件。

相关内容