|
老师好。我通过手动录制宏,可以设置页面边框 (即在word文档的四周各添加一条线,正好封闭像一个大口形状),代码如下。但该代码只是一时生效,当我新建一个word时就没有用了,请问如何修正录制的代码,或是有无其它方法解决呢?感谢老师~!
- Sub 宏1()
- With Selection.Sections(1)
- With .Borders(wdBorderLeft)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderRight)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderTop)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderBottom)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders
- .DistanceFrom = wdBorderDistanceFromPageEdge
- .AlwaysInFront = True
- .SurroundHeader = False
- .SurroundFooter = False
- .JoinBorders = False
- .DistanceFromTop = 24
- .DistanceFromLeft = 24
- .DistanceFromBottom = 24
- .DistanceFromRight = 24
- .Shadow = False
- .EnableFirstPageInSection = True
- .EnableOtherPagesInSection = True
- .ApplyPageBordersToAllSections
- End With
- End With
- With Options
- .DefaultBorderLineStyle = wdLineStyleSingle
- .DefaultBorderLineWidth = wdLineWidth050pt
- .DefaultBorderColor = wdColorAutomatic
- End With
- End Sub
复制代码
|
|