プロが教えるわが家の防犯対策術!

ワード2007、ヘッダーのマクロでフォントサイズを変更したい。
windows7、word2007
ヘッダーにファイル名、ページ数、作成日を表示させるマクロを”マクロの記録”で作りました。
夫々にはフィールドを指定してあります。

Sub header()
'
' header Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME \* DBCHAR ", PreserveFormatting:=True
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE \* ArabicDash ", PreserveFormatting:=True
Selection.TypeText Text:=vbTab & " "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"CREATEDATE \@ ""作成日 :ggge年M月d日"" ", PreserveFormatting:=True
Selection.TypeParagraph
Selection.TypeText Text:=vbTab & vbTab & " "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"SAVEDATE \@ ""更新日 :ggge年M月d日"" ", PreserveFormatting:=True
WordBasic.GoToFooter
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE ", PreserveFormatting:=True
Selection.TypeText Text:="/"
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"NUMPAGES ", PreserveFormatting:=True
End Sub

文書本文の文字サイズは13ptですがフッター部は9ptにしたいと思います。
修正する方法を教えて貰えるとありがたいです。
よろしくお願いいたします。

A 回答 (1件)

最後の行に以下の3行を入れればよいです。

そうしたら、フッターは変わります。
ただ、ヘッダー側にも変えるなら、 WordBasic.GoToFooter の手前に、同じく3行入れないと行けないはずです。


Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.Font.Size = 9
End Sub
    • good
    • 0
この回答へのお礼

Wendyさま 早速にご回答頂きましてまことにありがとうございました。
見事9Ptで表示することができました。
ヘッダーの方も教えて頂いた通りWordBasic.GoToFooter の手前に3行挿入してフォントサイズを変更することができました。
これまでもやもや、イライラしていたのが一挙解決すっきりしました。
これでまた一歩前進できます。
ほんとうにありがとうございました。

お礼日時:2010/05/15 00:55

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!