Results 1 to 6 of 6

Thread: Change font in MSWord when opening

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271

    Change font in MSWord when opening

    Hi, I'd like to change the font for a word document (MSWord 2000) when the document is opened. This document will actually be a template (.dot). Here is what I have so far:

    VB Code:
    1. Private Sub Document_Open()
    2.   'set font should be mono spaced
    3.   ActiveDocument.Content.Font.Name = "Curier New"
    4.   'write header
    5.   Selection.TypeText Text:="Some initial text"
    6.   Selection.TypeParagraph 'line feed cr
    7.   Selection.TypeParagraph 'line feed cr
    8. End Sub

    The problem I'm having is that after the initial text is typed (in the correct font by the way) word seems to revert back to the default font at the insertion point. In other words, when I start typing the document from the keyboard the font used is the default not the font I set up ( in this case Curier New).

    I've also tried it this way with the same results:
    VB Code:
    1. Selection.Font.Name = "Curier New"
    2.   'or
    3.   ActiveDocument.Range.Font.Name = "Curier New"
    Thanks for any help.
    Last edited by JohnVB6; Mar 24th, 2003 at 05:53 PM.
    Sometimes what you're looking for is exactly where you left it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width