none
Change Default Font to Arial Using The Manage Styles Button RRS feed

  • Question

  • Hi,

    Could someone help and tell me whether it is possible to set the default font to "Arial" size "11" in VBA.

    In the application I would change the default font and font size to Arial, size 11,  by using the button "Manage Styles" - "Set Default Tab". There have been suggestions on setting the default font in the Normal.dot but I dont want to do this as this will change the default font for all documents. I have googled this but have had no luck. I hope someone can help as it would be much appreciated.

    Louis

    Thursday, April 26, 2012 3:08 PM

Answers

  • Maybe try looking at the document.Styles collection.

    document.Styles(wdStyleDefaultParagraphFont).Font.Size = 12;

    document.Styles(wdStyleDefaultParagraphFont).Font.Name = "Ariel";


    EDIT: Or whatever that is in VBA. Sorry.
    Thursday, April 26, 2012 11:39 PM

All replies

  • Set as Default in the interface does set the font in Normal.dotm, so it will affect all new documents, so it's not clear to me what you want if you don't want to change Normal.dotm...

    Regards, Hans Vogelaar

    Thursday, April 26, 2012 3:43 PM
  • Hi Hans Vogelaar,

    Thanks for your response!

    Our testing is indicating that it seems to change at document level rather than the normal.dot level. If we open a document which has been created external to the organisation click on the manage style button and then set defaults tab, the default is set as New Times Roman where our documents default to Arial.

    The intention is to give users a button which will change the default font to our house style.

    Louis

    Thursday, April 26, 2012 3:50 PM
  • Maybe try looking at the document.Styles collection.

    document.Styles(wdStyleDefaultParagraphFont).Font.Size = 12;

    document.Styles(wdStyleDefaultParagraphFont).Font.Name = "Ariel";


    EDIT: Or whatever that is in VBA. Sorry.
    Thursday, April 26, 2012 11:39 PM
  • Hi JosephFox,

    This did not work as some of the text was still Times New Roman but you did give me an idea on how to go about solving this problem. Once you change the heading and numbering styles e.g. -

    'Change the headings to Arial
    For i = 1 To 9
        ActiveDocument.Styles("Heading " & CStr(i)).Font.Name = "Arial"
        ActiveDocument.Styles("Heading " & CStr(i)).Font.size = "11"
    Next i

    'Change the outline numbers to Arial
    With ActiveDocument.Styles(wdStyleHeading1)
    For Each m In .ListTemplate.ListLevels
    m.Font.Name = "Arial"
    m.Font.size = "11"
    Next m
    End With

    If you change the Normal style then it changes everything else in the document which has not yet been formatted using the code below -

    'Select normal style and change font and size
    With ActiveDocument.Styles("Normal").Font
    .Name = "Arial"
    .size = "11"
    End With

    Thanks alot for your help!

    Louis

    Friday, April 27, 2012 8:43 AM