|
- ' 臭冬瓜(QQ:84299244),分享日期:2024.06.19
- Option Explicit
- Sub 指定参数排版()
- '
- ' 1.图片宽度设置为10厘米
- ' 2.页边距都设置为2厘米
- ' 3.添加页码
- '
- Dim defPicWidth!, defPageMargin!
- defPicWidth = CentimetersToPoints(10)
- defPageMargin = CentimetersToPoints(2)
- Application.ScreenUpdating = False
- With ActiveDocument
- Dim myInShape As InlineShape
- For Each myInShape In .InlineShapes
- With myInShape
- .LockAspectRatio = msoTrue
- .Width = defPicWidth
- .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
- End With
- Next myInShape
- Set myInShape = Nothing
- With .PageSetup
- .TopMargin = defPageMargin
- .BottomMargin = defPageMargin
- .LeftMargin = defPageMargin
- .RightMargin = defPageMargin
- .FooterDistance = defPageMargin - CentimetersToPoints(0.5)
- End With
- .Styles("页眉").Borders.Enable = False
- With .Sections.First.Footers(wdHeaderFooterPrimary).Range
- .Fields.Add .Duplicate, wdFieldEmpty, "page", False
- .ParagraphFormat.Alignment = wdAlignParagraphCenter
- End With
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|