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