Microsoft Office Tutorials and References
In Depth Information
Wrapping Text to the Next Slide
'Keep it reasonable, between 2 and 15 lines in the textbox¶
If WrapCnt > 15 Or WrapCnt < 2 Then¶
'If it isn't in this range then tell the user what they did wrong¶
MsgBox "Please enter a number between 2 and 15" & _¶
", when you re-run this macro", vbCritical + _¶
vbOKOnly, "Input range error"¶
'Stop doing anything in this sub routine. They will have _¶
to re-run it and enter a valid number¶
Exit Sub¶
End If¶
'Initialize the slide counter¶
SldNum = 0¶
With ActivePresentation¶
'This is a line label. It can be referenced in a goto¶
'statement which is why it is used here.¶
NextSlide:¶
'Increment the slide counter¶
SldNum = SldNum + 1¶
'If this slide is more than the total number of _¶
slides then the macro is done and can goto the _¶
ending routine that is used¶
If SldNum > SldCnt Then GoTo EndRoutine¶
'Check if the number of lines in the textbox _¶
placeholder merits being wrapped to the next slide¶
If .Slides(SldNum).Shapes.Placeholders(2) _¶
.TextFrame.TextRange.Lines _¶
.Count <= WrapCnt Then GoTo NextSlide¶
'If it does need to be wrapped over to the next slide, _¶
then start by making a duplicate slide¶
.Slides(SldNum).Duplicate¶
'Now add one to the total number of slides because _¶
of the added slide¶
SldCnt = SldCnt + 1¶
'Get rid of all the lines on the original slide that _¶
will be repeated on the wrap over slide¶
.Slides(SldNum).Shapes.Placeholders(2) _¶
.TextFrame.TextRange.Lines(WrapCnt + 1, _¶
.Slides(SldNum).Shapes.Placeholders(2) _¶
.TextFrame.TextRange.Lines.Count).Delete¶
'On the second slide, get rid of all the lines _¶
that were on the first slide¶
.Slides(SldNum + 1).Shapes.Placeholders(2) _¶
.TextFrame.TextRange.Lines(1, WrapCnt).Delete¶
'Check the next slide¶
GoTo NextSlide¶
EndRoutine:¶
End With¶
Pwr
Search JabSto ::




Custom Search