Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-18-2011, 06:41 AM
ghumdinger ghumdinger is offline Don't add space between para of the same style Windows 7 Don't add space between para of the same style Office 2010 (Version 14.0)
Advanced Beginner
Don't add space between para of the same style
 
Join Date: Jul 2010
Posts: 64
ghumdinger is on a distinguished road
Default Don't add space between para of the same style

For some reason, Word shows a different behavior when I run a macro and when I execute the steps in the macro manually.

When I select everything (CTRL + A) in my document and uncheck "don't add space between paragraphs of the same style", it works for all paras.

I have captured that in a macro:



Selection.WholeStory
With Selection.ParagraphFormat
.SpaceBefore = 11
.SpaceBeforeAuto = False
.SpaceAfter = 11
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpace1pt5
.LineUnitBefore = 0
.LineUnitAfter = 0
.WordWrap = True
End With
End Sub


When I run the macro, it does NOT work for all paragraphs. It appears that paragraphs with the style "List paragraph", with multilevel bullets, are not affected by the macro instruction.

But if I replicate the macro steps personally, all the paras are affected. There is no section break in the document.

Any idea what's going on?

Thanks,
Jay
Reply With Quote
  #2  
Old 09-18-2011, 11:34 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Don't add space between para of the same style Windows 7 64bit Don't add space between para of the same style Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,907
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

The setting you mention can only be set for a Style object in Word. Using the Normal style as an example:

Code:
ActiveDocument.Styles("Normal").NoSpaceBetweenParagraphsOfSameStyle = False  ' spacing will be added
Yes, I know you can change it for the selection in the user interface with recent versions of Word, but this is either a bug or extended functionality not yet supported in VBA.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 09-18-2011 at 03:06 PM.
Reply With Quote
  #3  
Old 09-18-2011, 05:41 PM
ghumdinger ghumdinger is offline Don't add space between para of the same style Windows 7 Don't add space between para of the same style Office 2010 (Version 14.0)
Advanced Beginner
Don't add space between para of the same style
 
Join Date: Jul 2010
Posts: 64
ghumdinger is on a distinguished road
Default

Thanks Stefan. I wouldn't have know that there was such a queer norm in Word if you hadn't pointed it out.

I've added the code you provided for every style used (thankfully just 2 main ones), and the problem is solved.

Are there other significant formatting that behaves this way as well, for instance the language setting, or para spacing before and after?

Jay
Reply With Quote
  #4  
Old 09-19-2011, 02:04 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Don't add space between para of the same style Windows 7 64bit Don't add space between para of the same style Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,907
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Well, there are certainly settings that you can't apply as direct formatting to text. One example is "Style for following paragraph" in the Modify Style dialog box.

The settings that you mention--language and spacing before/after--can be specified for a selection as well as for a style, though.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't add space between para of the same style autocorrect double space to single space frankjake Word 8 09-21-2018 05:44 PM
Config style to restart numbering if it it comes after a style of a higher level ghumdinger Word 7 08-31-2011 01:10 AM
distorted last para lines when justifying RSF Word 0 08-18-2011 10:11 PM
Don't add space between para of the same style Is this a Tab space or Indentation space? Jamal NUMAN Word 1 06-30-2011 05:09 PM
Don't add space between para of the same style Tables that carry hidden para styles Ulodesk Drawing and Graphics 4 03-10-2011 08:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft