This snippet assumes the document has but the one section, and no different first page. Note that Word documents can be extremely complex, with multiple Section objects, and each section object can have a "normal" header and footers as well as optionally a different header and footer for the first page. The snippet also demonstrates how to access a document's default Header and Footer. The difference in my code is that it uses Document.Content which returns the Range for the main body of the document without needing to specify start and end values. The first changes the base style that underlies most of the font formatting you'll find in Word the second is basically what you have - applying the formatting as if you'd select the body of the document and format it. I used the font color to make things more obvious. ![]() The following snippet shows two alternatives for changing the font. I'm assuming the code you show us works for you as far as changing the font and saving the document.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |