Last Slide in presentation

J

Jaymac

I cocked up my last post -sorry guys (and gals)

With great help from you folks I have managed to get my macro to do what I
wanted with one exception - I want to put a button on the last slide of each
presentation as an indication to the operator.

Using macro recording I managed to work something out, but when I run the
macro I get a message saying that to select a shape the view must be active -
how do I do this? The macro works if I undo the first run and rerun the
macro but this is time-comsuming.

I am trying to put the whole church hymnary into powerpoint with a separate
ppt for each hymn - so you can see what I want to use a macro to automate
this.

Any help would be appreciated.

Jack
 
B

Bill Dilworth

Shyam has written an excellent explanation of the probable reason for this
at

A recorded macro might not work in the slide show mode.
Read more about it here: http://skp.mvps.org/ppt00027.htm


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
J

Jaymac

Hi Steve

Many thanks for responding again - you were a great help and will no doubt
recognise some of the coding.

The current coding is:

Sub FormatSlides()

Dim oSl As Slide
Dim count As Integer
count = 0

For Each oSl In ActivePresentation.Slides
With oSl
.FollowMasterBackground = msoTrue
.DisplayMasterShapes = msoTrue
.Shapes("Rectangle 3").Delete
With .Shapes("Rectangle 2").TextFrame.TextRange
.Paragraphs(Start:=1, Length:=0).ParagraphFormat.Alignment =
ppAlignCenter
.Font.Color.RGB = RGB(255, 255, 0)
.Font.Size = 50
End With
.Shapes("Rectangle 2").TextFrame.Ruler.TabStops.DefaultSpacing = 12

.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoTrue
With .Background
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(0, 0, 255)
.Fill.Transparency = 0#
.Fill.Solid
End With
With .Shapes("Rectangle 2")
.ScaleWidth 1.11, msoFalse, msoScaleFromBottomRight
.Left = 0
.ScaleHeight 5.6, msoFalse, msoScaleFromTopLeft
.Top = 0
End With
With .Shapes("Rectangle 2").TextFrame
.MarginRight = 20
.MarginLeft = 20
.HorizontalAnchor = msoAnchorNone
.VerticalAnchor = msoAnchorMiddle
End With
End With
count = count + 1
Next

If ActivePresentation.HasTitleMaster Then
With ActivePresentation.TitleMaster.HeadersFooters
With .DateAndTime
.Format = ppDateTimeMdyy
.Text = ""
.UseFormat = msoFalse
.Visible = msoFalse
End With
.Footer.Visible = msoFalse
.SlideNumber.Visible = msoTrue
End With
End If

With ActivePresentation.SlideMaster.HeadersFooters
With .DateAndTime
.Format = ppDateTimeMdyy
.Text = ""
.UseFormat = msoFalse
.Visible = msoFalse
End With
.Footer.Visible = msoFalse
.SlideNumber.Visible = msoTrue
End With

ActivePresentation.Slides(count).Select
*******
ActivePresentation.Slides(count).Shapes.AddShape(msoShapeActionButtonEnd,
24#, 480#, 30#, 30#).Select
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
.Action = ppActionNone
.SoundEffect.Type = ppSoundNone
.AnimateAction = msoTrue
End With
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseOver)
.Action = ppActionNone
.SoundEffect.Type = ppSoundNone
.AnimateAction = msoFalse
End With
MsgBox ("Done")

End Sub

with **** marking the point of failure.

I run a mcaro in word which converts verses to paragraphs with line breaks
between lines, and paragraphs only at the end of each verse - each verse
then becomes a separate slide when exported to PPT. There is absolutely no
format to the exported slides so I have a PPT macro in a separate
presentation which is called in manually in the new imported presentation.
When I run the macro it fails at the marked point. I then undo the complete
macro run and redo it with no problems. the error message is:

"Run time error '-2147188160(80048240)':

Shape (unknown member): Invalid request. To select a shape its view must be
active."

I have tried to make the required shape active but cannot find the method -
this would resolve my final problem.

Thanks again for your interest

Jack
 
J

Jaymac

Many thanks to those who responded. Steve's solution worked a treat and I am
quite happily using the macro.

Jack
 

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