|
求助遍历文件夹所有WORD文档后打开后不会自动关所有WORD,怎么处理
- Sub 批量删除页眉横线()
- Set MyDialog = Application.FileDialog(msoFileDialogFilePicker)
- With MyDialog
- .Filters.Clear
- .Filters.Add "所有 WORD 文件", "*.doc; *.docx; *.docm", 1
- .AllowMultiSelect = True '
- If .Show = -1 Then
- Application.ScreenUpdating = False
- For Each vrtSelectedItem In .SelectedItems
- Set Doc = Documents.Open(fileName:=vrtSelectedItem, Visible:=True)
- ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
-
- ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
- Selection.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
- ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
- Next
- Application.ScreenUpdating = True
- End If
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!", vbInformation
- End Sub
复制代码
|
|