Microsoft KB Archive/118518

Cannot Change Font in Header Using Macro PSS ID Number: Q118518 Article last modified on 07-21-1994

2.00 2.00a 2.00a-CD 2.00b 2.00c

WINDOWS

= SYMPTOMS =

If you record or write the following macro, the font command will not change the font characteristics of the header or footer text.

Sub MAIN ViewHeaderFooter .Type = 0 EditSelectAll Font “Arial”, 25 ClosePane End Sub

In addition, if you step through the macro while in the macro-editing window, the font characteristics will appear to change, but after the macro runs, the text reverts to the original formatting.

= STATUS =

Microsoft has confirmed this to be a problem in Word versions 2.x for Windows. This problem was corrected in Word 6.0 for Windows.

= RESOLUTION =

Use the FormatCharacter WordBasic command instead of the Font command. Change the macro to reflect the following:

Sub MAIN ViewHeaderFooter .Type = 0 EditSelectAll FormatCharacter .Font = “arial”, .Points = 25 ClosePane End Sub

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code “as is” without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Additional reference words: 2.00 2.00a 2.00a-cd 2.00b 2.00c w4wformat w4wbasic macro wordbasic word basic font formatcharacter format formatting change doesn’t

=
================================================================

Copyright Microsoft Corporation 1994.