Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to set the default line spacing in Powerpoint 2007 to 1.1 rather than 0.8 which Microsoft has set as default. Is there any way to do this?

Alternatively, I could also manage if I could create a macro that does this. But MS have also removed the Macro Recorder from PP2007. Can somebody help with the VBA code??

Thanks

share|improve this question

1 Answer

up vote 1 down vote accepted

Well, if you make a macro, you can use this code:

Sub SetLineSpacing()
Dim sld As Slide
Dim shp As Shape

For Each sld In Application.ActivePresentation.Slides
  For Each shp In sld.Shapes
    *If shp.TextFrame.HasText Then*
       With shp.TextFrame.TextRange.ParagraphFormat
          .LineRuleWithin = msoTrue
          .SpaceWithin = 1.1
       End With
     *End If*
   Next
 Next
End Sub

But there is one flaw. When you have some text with line spacing 3 (for example) but there is no space to have this kind of line spacing, powerpoint will automatically reduce it, ie. to 2.8. When you run this macro then, the line spacing will become 1.2 or 1.3 or something like that. Only when you run the macro a second time, it will repair this problem. I could not figure out where this problem was coming from though, since debugging the code made it work flawless from first run.

share|improve this answer
Hi Thanks for the effort. I tried your solution but am getting an error - that the specified value is out of range. Please see these screenshots for more details of the error: goo.gl/lLCK4 and and goo.gl/ssVFD – Vinayak Feb 21 '11 at 9:11
@vinayak I updated the code with an extra check if the shape contains some text. This error happens mostly on tables or placeholder shapes with no text in them. (the * are to show the edited lines of code, remove before use) – Yohsoog Feb 22 '11 at 0:00
perfect. it works now. thanks – Vinayak Jul 21 '11 at 7:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.