VBA for Global PowerPoint Character Spacing Normalization

dor1angray

New Member
Joined
Jun 30, 2016
Messages
7
I am trying to come up with a solution to normalize all character spacing across all slides in a single PowerPoint document in one go. I have come up with a macros that do it for all shapes but it keeps skipping text in tables. However, when I add msoTable into the range it starts processing the slides but when it hits the first table it immediately returns a run-time error claiming that the specified value is out of range.:confused:
Any idea what is wrong? Pretty sure it is a simple fix. Any help is truly appreciated. Thanks in advance!
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">Sub SpacingNormalization()
On Error GoTo ErrMsg
Dim shape As shape
slideCount
= ActivePresentation.Slides.Count
For i = 1 To slideCount
With ActivePresentation.Slides(i)
.Select
For Each shape In ActivePresentation.Slides(i).Shapes
If shape.Type = msoPlaceholder Or shape.Type = msoTextBox Or shape.Type = msoAutoShape Or shape.Type = msoTable Then
shape
.Select
ActiveWindow
.Selection.ShapeRange.TextFrame2.TextRange.Font.Spacing = 0
End If
ErrMsg
:
Next
End With
Next
MsgBox
("All segments have been normalized!")
End Sub</code>
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top