一劳永逸+批量修改word文件作者名

 时间:2026-02-14 15:07:19

1、一劳永逸的办法(修改默认作者名,但是已创建的文档不能修改),工具-选项-用户信息选项页,把姓名该成你自己想要显示的就行了,以后创建的word均为此作者名。

2、批量修改已存在的文档作者名的方法:在Word里面随便新建一个文档,键入Alt+F11打开VBA编辑器

3、执行“插入-模块”,并在下面的代码编辑区中粘贴如下代码并做修改:

4、Option ExplicitConst g_strRootPath = "c:\Temp\docs\Word\ToChangeAuthors\"(修改此处为你的文件存放目录)Const g_strAuthorName = "作者姓名"(修改此处为你要的作者名)Sub ChangeAllDocAuthors()    On Error Resume Next    Dim strPreviousUserName As String    Dim fso, oFolder    strPreviousUserName = Application.UserName    Application.UserName = g_strAuthorName    Set fso = CreateObject("Scripting.FileSystemObject")    Set oFolder = fso.GetFolder(g_strRootPath)    ChangeAllDocAuthorsUnderFolder fso, oFolder    Application.UserName = strPreviousUserName        MsgBox "完成!"End SubSub ChangeAllDocAuthorsUnderFolder(fso, oFolder)        Dim oSubFolder, oFile    Dim strTitle As String, strFileName As String    For Each oSubFolder In oFolder.SubFolders        ChangeAllDocAuthorsUnderFolder fso, oSubFolder    Next    For Each oFile In oFolder.Files        Documents.Open FileName:=oFile.Path        ActiveDocument.BuiltInDocumentProperties("Author") = g_strAuthorName        ActiveDocument.BuiltInDocumentProperties("Last Author") = g_strAuthorName        ActiveDocument.Close True    NextEnd Sub

  • Word 2013中使用修订功能的操作
  • MathType怎么输入斜环积分
  • 2010版Word文档表格编号自动更新教程
  • eclipse和myeclipse整个项目中查找指定代码
  • word在标题栏中显示文档路径
  • 热门搜索
    智圣汤泉旅游度假村 雪野湖旅游区 去朝鲜旅游多少钱 西安有什么旅游景点 江西省旅游局官网 洛阳旅游景点介绍 蚂蚁网旅游 杭州到黄山旅游攻略 阜阳旅游景点大全 十一去哪旅游好