- Sub 网友排版Word2003VBA()
- With ActiveDocument
- With .Content
- With .Find
- .Execute "^13", , , , , , , , , "`", 2
- .Execute "^11", , , , , , , , , "`", 2
- .Execute "```", , , , , , , , , "`", 2
- .Execute "``", , , , , , , , , "`", 2
- End With
- .ConvertToTable Separator:=wdSeparateByParagraphs, NumColumns:=1, AutoFitBehavior:=wdAutoFitFixed
- End With
- Selection.Cells.Split NumRows:=1, NumColumns:=2, MergeBeforeSplit:=False
- Selection.ParagraphFormat.CharacterUnitFirstLineIndent = 2
- .Content.Find.Execute "`", , , , , , , , , "^p", 2
- .Tables(1).Range.Cells(1).Range.Characters.Last.Previous.Delete
- .Tables(1).Style = "网格型"
- End With
- ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- NormalTemplate.AutoTextEntries("第 X 页 共 Y 页").Insert Where:=Selection.Range, RichText:=True
- ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
- End Sub
复制代码 |