如何给文件夹中的 word 文档批量修改 页眉页脚和水印Private Sub CommandButton1_Click()Dim doc As Document, ph$, f$ph = ThisDocument.Path & “新建文件夹“f = Dir(ph & “*.doc*“)Do While f “Set doc = Documents.Open(ph & f, Visible:=False)doc.Sections(1).Headers(1).Range.Text = “课本知识要点汇总“With doc.Sections(1).Headers(1).Shapes.AddPicture(ph & “水印图片.png“, 0, 1).Height = CentimetersToPoints(21).Width = CentimetersToPoints(51).RelativeHorizontalPosition = 0: .Left = wdShapeCenter.RelativeVerticalPosition = 0: .Top = wdShapeCenterEnd Withdoc.Close -1, 1f = DirLoopMsgBox “操作完毕并保存!“End Sub