|
本帖最后由 zldccmx 于 2023-2-8 09:03 编辑
<CODE>
'切换到VBE界面 ALT + F11
'粘贴以下代码 CTRL + V
'按F5运行 F5
'
Sub zldccmx()
Application.ScreenUpdating = False
Application.DisplayAlerts = wdAlertsNone
Selection.WholeStory '全选
Selection.Copy '复制
Documents.Add '新建文档
Selection.Paste '粘贴到新建文档
With ActiveDocument.PageSetup
.PaperSize = wdPaperA4 'A4纸
.Orientation = wdOrientPortrait '纵向
'.Orientation = wdOrientLandscape '横向
.TextColumns.SetCount NumColumns:=1 '取消分栏 :分栏数为1
End With
Fn = ThisDocument.Path & "\" & Left(ThisDocument.Name, _
InStrRev(ThisDocument.Name, ".")) & "(备份).doc" '命名
ActiveDocument.SaveAs2 Fn, 0 '另存
ThisDocument.Close , False '关闭原始文档
Application.ScreenUpdating = True
End Sub
</CODE>
|
|