找回密码
 立即注册
搜索

一页9张PPT自动排版宏命令

1
回复
568
查看
[复制链接]

4

主题

10

帖子

45

幻币

一流武者

Rank: 3Rank: 3

积分
239
QQ
2013-8-27 00:00:00 显示全部楼层 |阅读模式
【调整页边距及页眉页脚距,适用于A4纸】
With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientLandscape
.TopMargin = CentimetersToPoints(0.6)
.BottomMargin = CentimetersToPoints(0.6)
.LeftMargin = CentimetersToPoints(1)
.RightMargin = CentimetersToPoints(0.8)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(0.5)
.FooterDistance = CentimetersToPoints(0.9)
.PageWidth = CentimetersToPoints(29.7)
.PageHeight = CentimetersToPoints(21)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
.LayoutMode = wdLayoutModeLineGrid
End With

【调整每张幻灯片的大小为高184宽262,也许还有更佳的值,可自己尝试】

Dim i As Integer
For i = 1 To ActiveDocument.InlineShapes.Count
ActiveDocument.InlineShapes(i).Height = 184
ActiveDocument.InlineShapes(i).Width = 262
Next i

【给每张幻灯片加边框】

Selection.HomeKey Unit:=wdStory

Dim j As Integer
For j = 1 To ActiveDocument.InlineShapes.Count

Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With Selection.InlineShapes(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
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With

Selection.MoveRight Unit:=wdCharacter, Count:=1
Next j

End Sub
PPT学习论坛
回复

使用道具 举报

0

主题

51

帖子

62

幻币

一流武者

Rank: 3Rank: 3

积分
349
QQ
2017-3-21 08:46:12 显示全部楼层
好好学习,天天向上!
PPT学习论坛
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册