Wednesday 7 March 2018

microsoft word - Remove setting from style to inherit setting from base style


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



Answer



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

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...