none
Create New Style based on Normal Style and customize it RRS feed

  • Question

  • I am working on Office.Interop.Word using c#. I have a simple winform and has a button and all this button does,  place the name of the document at the footer. . 

    How can I copy the normal style and add a new style based on normal style. FOr example, the normal style default font is Times New Roman and size is 12. And I want to create a new style where font will be Arial and size will be 6. 

    Tuesday, June 26, 2018 12:43 PM

All replies

  • Hello,

    The default font while creating new style is based on current font setting. So, if we change current font name as Arial and size as 6, the created style will have the same setting.

    So the code could be.

    oWord.Selection.Font.Name = "Arial";
                oWord.Selection.Font.Size = 6;
                oWord.ActiveDocument.Styles.Add("MyCustomStyle");

    By the way, what's the state of below threads? Please feel free to let us know if you have any updates for them.

    Text box in Different First Page Footer 

    Footer style changing entire footer

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, June 27, 2018 2:54 AM