|
初めての質問です。
wordにマクロの記録で書式を設定しました。
デスクトップ上のフォルダ内にある複数のword文書を一括処理をさせたいのですが(文書名の決まりはありません。数は20〜30文書)
マクロは下記に記します。Windows7 、office standard 2010です。
ご教示よろしくお願いいたします。
Sub 書式マクロ3()
'
' 書式マクロ3 Macro
'
'
Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Name = "MS P明朝"
Selection.Font.Size = 16
Selection.Font.Bold = wdToggle
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.Font.Size = 11
Selection.TypeParagraph
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Name = "MS P明朝"
Selection.Font.Size = 12
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.Font.Size = 11
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.Font.Name = "MS P明朝"
Selection.Font.Size = 11
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = MillimetersToPoints(35)
.BottomMargin = MillimetersToPoints(30)
.LeftMargin = MillimetersToPoints(30)
.RightMargin = MillimetersToPoints(30)
.Gutter = MillimetersToPoints(0)
.HeaderDistance = MillimetersToPoints(15)
.FooterDistance = MillimetersToPoints(17.5)
.PageWidth = MillimetersToPoints(210)
.PageHeight = MillimetersToPoints(297)
.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
.LinesPage = 42
.LayoutMode = wdLayoutModeLineGrid
End With
End Sub
|
|