20

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

2
  • Would setting space-after to "Auto" in your Subject style work?
    – Adam
    Dec 3, 2012 at 10:06
  • @Adam no, setting it to "Auto" did not work (tried it). I believe "Auto" means "use font size/line height as space-after".
    – SealedSun
    Dec 3, 2012 at 11:58

4 Answers 4

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
10
  • Interesting, will try this when I get home, thanks :)
    – SealedSun
    Dec 5, 2012 at 6: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, 2012 at 22:09
  • 3
    2.5 yrs later, is this still the best option?
    – dualed
    Mar 18, 2015 at 15:08
  • 3
    4 years and an entire new version of Office later, is this still the only option?
    – wersimmon
    Jan 6, 2017 at 17:59
  • 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, 2020 at 13:29
6

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.

5
  • 2
    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, 2020 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? Apr 10, 2021 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 7, 2021 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 8, 2021 at 18:50
  • This works for paragraph styles (as requested in the question) but it cannot be transferred to character styles, unfortunately, since those have an unknown base style by definition.
    – Douba
    Nov 21 at 15:04
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.
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .