adding slides as needed for overflow

B

Betsy Yanasak

Hi! When I came across the macro created by Bill Dilworth to automatically
create new slides as bulleted lists get too long, I thought it would answer
all my prayers (I'm building a new powerpoint template). I followed the
instructions as best as I could, but when I went to run the macro, I got the
following error:

"Compile Error: Method or data member not found" highlighting
"Lines.Count)" in line 32 of the code.

I would really like for this to work, and I know very little about VBA. Can
anyone help me troubleshoot how to fixt this and make it work in my
presentation template?

PS. I'm running PowerPoint 2002.

Thank you,
Betsy


Here's Bill Dilworth's macro for reference:

"I wrote this macro for this exact same reason. It will go thru your
slides and move any text over a limit you set to a new slide. There are a
couple of things to keep the macro easy:


1.. It only evaluates the number of lines, not the size of the text.
2.. The text must be in the 'Click to add text' placeholder.
3.. It evaluates each slide in the entire presentation, not just one or
two selected ones.

Cut and paste this whole ugly mess into the VBE and run the macro on a
copy of your presentation. If you need any additional help with this, post
on the PowerPoint newsgroup. We're here to help."




Here's Bill's code:


Option Explicit
Sub WrapOver()
Dim SldCnt As Integer
Dim SldNum As Integer
Dim WrapCnt As Integer
Dim OldCnt As Integer

SldCnt = ActivePresentation.Slides.Count
OldCnt = SldCnt
WrapCnt = InputBox("'Wrap' text in placeholder " & _
"if they exceed how many lines?", "Wrap after" & _
"input", "6")

If WrapCnt > 15 Or WrapCnt < 2 Then
MsgBox "Please enter a number between 2 and 15" & _
", when you re-run this macro", vbCritical + _
vbOKOnly, "Input range error"
Exit Sub
End If

SldNum = 0
With ActivePresentation
NextSlide:
SldNum = SldNum + 1
If SldNum > SldCnt Then GoTo EndRoutine
If .Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines _
.Count <= WrapCnt Then GoTo NextSlide
.Slides(SldNum).Duplicate
SldCnt = SldCnt + 1
.Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines(WrapCnt + 1, _
.Lines.Count).Delete
.Slides(SldNum + 1).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines(1, WrapCnt).Delete
GoTo NextSlide

EndRoutine:
End With
MsgBox "Task complete. " & SldCnt - OldCnt & _
" slides were added.", vbOKOnly, WrapCnt & _
" line max. macro"

End Sub
 
A

Austin Myers

Betsy,

I'd suggest you write to Bill directly.


Austin Myers
MS PowerPoint MVP Team
 
B

Bill Dilworth

Oops. Try this slight modification:

=====Begin Code=====
Option Explicit
Sub WrapOver()
Dim SldCnt As Integer
Dim SldNum As Integer
Dim WrapCnt As Integer
Dim OldCnt As Integer

SldCnt = ActivePresentation.Slides.Count
OldCnt = SldCnt
WrapCnt = InputBox("'Wrap' text in placeholder " & _
"if they exceed how many lines?", "Wrap after" & _
"input", "6")

If WrapCnt > 15 Or WrapCnt < 2 Then
MsgBox "Please enter a number between 2 and 15" & _
", when you re-run this macro", vbCritical + _
vbOKOnly, "Input range error"
Exit Sub
End If

SldNum = 0
With ActivePresentation
NextSlide:
SldNum = SldNum + 1
If SldNum > SldCnt Then GoTo EndRoutine
If .Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines _
.Count <= WrapCnt Then GoTo NextSlide
.Slides(SldNum).Duplicate
SldCnt = SldCnt + 1
With .Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange
.Lines(WrapCnt + 1, .Lines.Count).Delete
End With
.Slides(SldNum + 1).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines(1, WrapCnt).Delete

GoTo NextSlide

EndRoutine:
End With
MsgBox "Task complete. " & SldCnt - OldCnt & _
" slides were added.", vbOKOnly, WrapCnt & _
" line max. macro"

End Sub

=====End Code=====

--
Bill Dilworth
Microsoft PPT MVP Team
Users helping fellow users.
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of your questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
B

Betsy Yanasak

Thank you Bill, that worked!!

Bill Dilworth said:
Oops. Try this slight modification:

=====Begin Code=====
Option Explicit
Sub WrapOver()
Dim SldCnt As Integer
Dim SldNum As Integer
Dim WrapCnt As Integer
Dim OldCnt As Integer

SldCnt = ActivePresentation.Slides.Count
OldCnt = SldCnt
WrapCnt = InputBox("'Wrap' text in placeholder " & _
"if they exceed how many lines?", "Wrap after" & _
"input", "6")

If WrapCnt > 15 Or WrapCnt < 2 Then
MsgBox "Please enter a number between 2 and 15" & _
", when you re-run this macro", vbCritical + _
vbOKOnly, "Input range error"
Exit Sub
End If

SldNum = 0
With ActivePresentation
NextSlide:
SldNum = SldNum + 1
If SldNum > SldCnt Then GoTo EndRoutine
If .Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines _
.Count <= WrapCnt Then GoTo NextSlide
.Slides(SldNum).Duplicate
SldCnt = SldCnt + 1
With .Slides(SldNum).Shapes.Placeholders(2) _
.TextFrame.TextRange
.Lines(WrapCnt + 1, .Lines.Count).Delete
End With
.Slides(SldNum + 1).Shapes.Placeholders(2) _
.TextFrame.TextRange.Lines(1, WrapCnt).Delete

GoTo NextSlide

EndRoutine:
End With
MsgBox "Task complete. " & SldCnt - OldCnt & _
" slides were added.", vbOKOnly, WrapCnt & _
" line max. macro"

End Sub

=====End Code=====

--
Bill Dilworth
Microsoft PPT MVP Team
Users helping fellow users.
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of your questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top