none
help to disable auto numbering from style panel RRS feed

  • Question

  • Hi , Can any one suggest me how do i disable auto numbering form Style panel using VB.net, i know one way of doing it 

    Application.Selection.NoProofing = True .

    but this is not my requirement, i need to do it from style panel formating option, 

    any suggention will be appritiated

    Thanks in Advance

    Tuesday, May 14, 2013 4:05 AM

Answers

  • Hello,

    Welcome to Word for Developers forum.

    According to my knowledge, we cannot modify the build-in groups, galleries or buttons on the Ribbon. Please have a look at this page:

    Can I customize the Ribbon? 

    "Add to or rearrange the commands on the Ribbon", "Change or remove a command or group on the Ribbon" fall in the part of "Things you can't do".

    However, "Use XML and programming code to extend the Office Fluent user interface by adding custom tabs, buttons, check boxes, or Dialog Box Launchers" is what you can do with the Ribbon.

    You can add a new button to a built-in tab or a new tab. Then you can use this button to set style for a range and turn off automatic numbering at the same time.

    --How to add the button:

    You can do it via Ribbon Designer or Ribbon XML, refer to this for details:

    Ribbon Overview

    (Ribbon XML file)

    <tab idMso="TabHome"> <!--or a new tab-->
      <group id="myStyles" label ="myStyles">
        <button id="myButton" label ="myButton" size ="large" onAction ="MyStyle"/>
      </group>
    </tab>

    --How to set style

    You can set this sub to the button's OnAction attribute. This sub should locate in Ribbon1.vb file, "Ribbon Callbacks" Region

    Public Sub MyStyle(ByVal control As Office.IRibbonControl)
        Globals.ThisAddIn.Application.Selection.Range.Style = Word.WdBuiltinStyle.wdStyleHeading1
        Globals.ThisAddIn.Application.Selection.NoProofing = True
    End Sub

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 16, 2013 9:41 AM
    Moderator

All replies

  • Hello,

    Welcome to Word for Developers forum.

    According to my knowledge, we cannot modify the build-in groups, galleries or buttons on the Ribbon. Please have a look at this page:

    Can I customize the Ribbon? 

    "Add to or rearrange the commands on the Ribbon", "Change or remove a command or group on the Ribbon" fall in the part of "Things you can't do".

    However, "Use XML and programming code to extend the Office Fluent user interface by adding custom tabs, buttons, check boxes, or Dialog Box Launchers" is what you can do with the Ribbon.

    You can add a new button to a built-in tab or a new tab. Then you can use this button to set style for a range and turn off automatic numbering at the same time.

    --How to add the button:

    You can do it via Ribbon Designer or Ribbon XML, refer to this for details:

    Ribbon Overview

    (Ribbon XML file)

    <tab idMso="TabHome"> <!--or a new tab-->
      <group id="myStyles" label ="myStyles">
        <button id="myButton" label ="myButton" size ="large" onAction ="MyStyle"/>
      </group>
    </tab>

    --How to set style

    You can set this sub to the button's OnAction attribute. This sub should locate in Ribbon1.vb file, "Ribbon Callbacks" Region

    Public Sub MyStyle(ByVal control As Office.IRibbonControl)
        Globals.ThisAddIn.Application.Selection.Range.Style = Word.WdBuiltinStyle.wdStyleHeading1
        Globals.ThisAddIn.Application.Selection.NoProofing = True
    End Sub

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 16, 2013 9:41 AM
    Moderator
  • Hi Damon Zheng,

                         Thanks for your reply, i will make my point more clear :-

    I created a Paragraph Style with name "List 1" and added the Numbering(Arabic numbering) on it, now i need to change this Numbering to None Programmtically in the file. 

    Can You suggest anything on this?

    Thanks in Advance

    Friday, May 17, 2013 6:26 AM
  •  now i need to change this Numbering to None Programmtically in the file. 

    I am not quite get what you mean by this. Do you mean manually turning off the automatic numbering instead of programmatical way?

    If you mean to disable automatic numbering when setting a style for a selected range, my previous reply has provided a possible way.


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 17, 2013 6:47 AM
    Moderator
  • Hello Neha4java,

    Since you haven't answered my further question in my last reply, I temporarily mark my previous reply as answer.

    If you disagree with it, please unmark it.

    Thanks for your understanding.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 27, 2013 4:32 PM
    Moderator