18

In my Microsoft Word 2010 document I have two paragraph styles: Normal and Subject. Subject has "Style based on" set to Normal (inherits from Normal). In Normal, I have configured a 12pt gap after each paragraph and Subject inherited this rule just fine.

Then I accidentally added a space-after-paragraph rule to Subject, too. This means that Subject no longer "inherits" its space-after-paragraph setting from Normal, meaning that if I change the setting on Normal, I will have to change it on Subject as well.

I'd like to remove the space-after-paragraph setting from Subject so that it once again inherits that value from Normal. Is this possible? If so, how?

I tried deleting the value (12pt), hitting OK, Enter but the setting just reverts to 12pt (overriding the value set in Normal). Short of re-creating the Subject style from scratch I don't know how to solve this.

Thanks

SealedSun
  • 2,129
  • 3
  • 18
  • 18

4 Answers4

11

Turns out there is already an article about this very topic (down to the space-after property being used as an example) available on the word.mvps.org website.

The general idea is you need to use a VBA macro once to clear the formatting. Microsoft Word would benefit from such feature included in the GUI.

Dim oStyle As Style
Set oStyle = ActiveDocument.Styles("Subject")
oStyle.ParagraphFormat.SpaceAfter = oStyle.BaseStyle.ParagraphFormat.SpaceAfter
Adam
  • 7,361
  • 2
  • 26
  • 41
  • Interesting, will try this when I get home, thanks :) – SealedSun Dec 05 '12 at 06:04
  • 1
    Seems to work, but that's not really a solution that people can use every day. That's naturally not your fault, so I'll accept your answer nonetheless. – SealedSun Dec 10 '12 at 22:09
  • Thanks. You can add the macro to GUI by adding it to the quick access toolbar. See this link for further details: http://gregmaxey.mvps.org/word_tip_pages/add_macro_to_qat.html This is the best you will get :) – Adam Dec 10 '12 at 22:32
  • Hm… right, and then I just have to write a GUI that takes a style and setting name and… Maybe next year XD – SealedSun Dec 10 '12 at 22:43
  • 3
    2.5 yrs later, is this still the best option? – dualed Mar 18 '15 at 15:08
  • @dualed, Yes, I would say so. – Adam Mar 19 '15 at 14:35
  • 3
    4 years and an entire new version of Office later, is this _still_ the only option? – wersimmon Jan 06 '17 at 17:59
  • @harbichidian, I would assume so although I don't have a new version of Office to test with, I doubt this bug would have been fixed. – Adam Jan 19 '17 at 23:22
  • 3
    8 years later and still this feature is missing. They did a "good" job in Excel though, including a [Clear] button when defining cells custom conditional formatting. Hoping the feature will propagate to Word styles.. – Ama Aug 22 '20 at 13:29
5

This is an old question, but still valid, and the answers given so far are not very practical. A simple way to cancel a definition, that deviates from the "Style based on", is to define the property to be the same as in "Style based on". This will remove the definition completely, because it is then useless.

As an example (and a specific answer to the original question), if your style is based on Normal, check what is the Spacing-After value in Normal style. Then change (Styles->[your style]->Modify->Format->Paragraph) the Spacing-After value in your style to be the same as in Normal style. (As default, at least in Word 2019 this value seems to be 8 pt, so you have to write the number 8 instead of clicking down-up, that goes in steps of 6 pt). After that, the style specific Spacing-After definition disappears.

Malakias
  • 61
  • 1
  • 2
  • 1
    Interesting one, which then makes me wonder what if you actually want the property to override the base style. That is, at the moment it has the same property, but you want that property to remain as is, even if the base style is then subsequently updated. – Ama Aug 22 '20 at 13:32
  • OK This is a very interesting solution to the problem. I wonder if the same thing happens if you do the opposite: change a parent's style to match it's child style -- does the child then "lose" its specific definition? – Sanjay Manohar Apr 10 '21 at 15:50
  • Mac Users: I tried removing the specified typeface from a paragraph style in Word for Mac v16— doesn't work, sadly. The settings summary in the style modal indicates it would, but the new parent style's font still doesn't propagate. – ChefAndy Dec 07 '21 at 18:35
  • Scratch that— I dug into the XML and it turns out there was a character style associated with the paragraph style. My experience isn't relevant. – ChefAndy Dec 08 '21 at 18:50
1

To avoid using VBScript, you can do it by creating a "fully empty style", and then inherit and modify the desired properties:

  1. Show the Home tab of the ribbon
  2. Display the styles panel, using the arrow on the bottom right of the styles toolbar
  3. Select a paragraph of the style you want to modify, and click "Clear All" from the styles panel
  4. Keep the paragraph selected, and right click on the style name on the panel an choose "modity style to match the selection" (perhaps there's a different wording. I'm using Word in another language )
  5. Right click and choose modifcy the style, to set the parent style to inherit from, and modify desired properties.
JotaBe
  • 149
  • 1
  • 5
1

TL;DR: Edit the XML definition of the style.

Setting the value to the BaseStyle value is a one-time fix, not something that restores inheritance. The values are explicitly set to the values of the base style, BUT not to inherit.

Example: Char style C1 is based on the defaults of para style List Number 2. LN2 is based on Normal. Normal font is Calibri 11 pt black. Open C1 and you see its font & size are blank. Change to Arial 10 and it's now forever an explicit value. Run the macro and C1 is set back to Calibri 11 pt black - not blank (inherited)! Change LN2 and C1 stays Calibri 11 pt black - not LN2's font and size. I haz a sad.

From an XML perspective, style grrr has w:color set to green. Its base style has 11 pt text

<w:style w:type="character" w:customStyle="1" w:styleId="grrr">
    <w:name w:val="grrr"/>
    <w:basedOn w:val="DefaultParagraphFont"/>
    <w:uiPriority w:val="1"/>
    <w:qFormat/>
    <w:rsid w:val="009014C2"/>
    <w:rPr>
        <w:color w:val="00B050"/>
    </w:rPr>
</w:style>

Note w:sz is not defined.

After a manual change to 8 pts the XML appears as such: <w:sz w:val="16"/>

After use of the .BaseStyle macro above, it is explicitly set to 11 pts in the XML: <w:sz w:val="22"/>

That's not inheritance. That's explicit setting to the value of the base style.

Manual removal of <w:sz w:val="22"/> from the XML restored inheritance. And that is a ridiculous solution.

In the UI, we see the font size is 11 pts. That's the same value as the base style, and was set using the BaseStyle approach, but it's the same as manually setting it to 11. enter image description here

When I change the base style, text formatted using Asset Title doesn't change. There's no inheritance - it's just 11 pts.

After editing docname.docx\word\styles.xml (without linearizing!) to remove <w:sz w:val="22"/> we see inheritance has been restored - the font size control is empty, which is Word's way of telling us the value is inherited.

enter image description here

When I change the base style, text formatted using Asset Title changes. There's inheritance - it's 11 pts because its parent is 11 pts.

Neman
  • 310
  • 1
  • 12