How to Increase Paragraph Spacing by Points in PowerPoint VBA
Question details
The user needs to increase the paragraph spacing before a text block by exactly 6 points using PowerPoint VBA, but the macro adds an unexpectedly large amount of space.

- Product
- PowerPoint
- Device & OS
- not provided
- Scenario
- Running a VBA macro to format text box paragraph spacing in a presentation.
- Observed behavior
- When adding a numerical value to SpaceBefore, the spacing jumps drastically because the system interprets the value as lines instead of points.
Before modifying your macro, make sure you have your PowerPoint presentation open, the Developer tab enabled, and a backup of your current VBA code saved.
Explicitly Set LineRuleBefore to False in VBA
By setting the line rule property to False, you force PowerPoint to strictly interpret your spacing increment as points rather than lines.
In PowerPoint's VBA object model, paragraph spacing can be measured in either lines or points. If the LineRuleBefore property is True (or undefined), PowerPoint assumes the SpaceBefore value represents whole lines. Explicitly declaring it False ensures the measurement defaults to exact points.
Press Alt + F11 to open the VBA Editor in PowerPoint, and locate the module containing your text formatting macro.
Ensure you have defined your text range properly, for example: Set textRange = ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange, and declare a variable to hold the current spacing.
Insert the command textRange.ParagraphFormat.LineRuleBefore = False into your code immediately before making spacing adjustments.
Add your 6 points to the spacing property using the code: textRange.ParagraphFormat.SpaceBefore = currentSpacing + 6.

Adjust Paragraph Spacing via Slide Master
If you prefer not to use VBA, you can globally set paragraph spacing to exact points using PowerPoint's Slide Master view.
Adjust Paragraph Spacing Easily in WPS Presentation
If you want to avoid complex VBA macros just to format text, WPS Presentation allows you to precisely adjust paragraph spacing in points directly from an intuitive and familiar interface.
- 1. Open Your Presentation: Launch WPS Presentation and open your slideshow.
- 2. Select the Text: Highlight the text box or specific paragraph you want to modify.
- 3. Open Paragraph Settings: Right-click the highlighted text and select 'Paragraph' from the context menu.
- 4. Apply Exact Spacing: Under the Spacing section, enter '6 pt' directly into the 'Before' field and click OK to apply the exact formatting instantly.

Frequently Asked Questions
Why does my PowerPoint VBA paragraph spacing increment by massive amounts?
This usually happens because the LineRuleBefore property is either set to True or defaulting to True. When True, PowerPoint interprets any numerical value added to SpaceBefore as lines instead of points. For example, adding '6' adds 6 whole lines of space rather than 6 points.
Can I format point-based paragraph spacing without using VBA?
Yes. You can use the Slide Master view to pre-define the Spacing Before value in precise points for different text levels, which then applies globally across your presentation without needing a macro.
What is the difference between SpaceBefore and LineRuleBefore in PowerPoint?
SpaceBefore determines the numerical amount of space above a paragraph, while LineRuleBefore is a boolean (True/False) setting that dictates whether that numerical amount is measured in single lines (True) or exact points (False).




