I'm working with a PowerPoint presentation where I would like to propogate a
slide with Linked Slide Objects. I am able to do this with the below code.
The problem is, I do not know how to do 2 things. 1) Return the object
reference (is this .shapes(?)) in order to resize and move the pastespecial
objects so they are not overlayed
2) Edit the new shape so that it has a hyperlink "to a place in this document"
as the slide just copied. I'm sure I can use the backupindex in some way for
this but cannot reference the shape to set the hyperlink. This step is
required so that during slide show, the presenter can see the available
"backup" slides and click the object to jump to the slide.
' This clears the clipboard to prevent memory problems and is called in the
propogate Sub
Private Declare Function OpenClipboard Lib "user32" (ByVal NewOwner As Long)
As Boolean
Private Declare Function EmptyClipboard Lib "user32" () As Boolean
Private Declare Function CloseClipboard Lib "user32" () As Boolean
Function ClearClipboard() As Boolean
If OpenClipboard(0) Then
EmptyClipboard
CloseClipboard
End If
End Function
Private Sub propogateBackups_Click()
Dim backupSelectIndex, backupIndex, shapeIndex As Integer
' SlideID 767 is "Backup Slide" selection slide and is used to identify where
to begin when creating the pastespecial linked shapes
backupSelectIndex =
ActivePresentation.Slides.FindBySlideID(767).SlideIndex
backupIndex = ActivePresentation.Slides.FindBySlideID(767).SlideIndex
' My attempt to find the shape index of the newly created object/shape in
order to resize and move--this used in a later step--I don't think this works
correctly
shapeIndex = ActivePresentation.Slides(backupSelectIndex).Shapes.Count
' Loops for all Backup Slides and adds to Backup Selection Slide
Do
backupIndex = backupIndex + 1
shapeIndex = shapeIndex + 1
With ActivePresentation
.Slides(backupIndex).Copy
.Slides(backupSelectIndex).Shapes.PasteSpecial link:=msoTrue
' This does not work to change size/position--I need help with this
' .Slides(backupSelectIndex).Shapes(shapeIndex).ActionSettings
(ppMouseClick)
'
.Slides(backupSelectIndex).Shapes(shapeIndex).ActionSettings(ppMouseClick).Act
ion = ppActionHyperlink
'
.Slides(backupSelectIndex).Shapes(shapeIndex).ActionSettings(ppMouseClick).Hyp
erlink.Address = _
' .Slides(backupIndex)
'
ActivePresentation.Slides(backupSelectIndex).Shapes(shapeIndex).ScaleHeight
'
ActivePresentation.Slides(backupSelectIndex).Shapes(shapeIndex).ScaleWidth
End With
' Clear the Clipboard for memory considerations
Call ClearClipboard
' This step identifies a marker slide--all backup slides will be added between
this slide and slides(767)
Loop Until ActivePresentation.Slides(backupIndex+1).SlideID = 749
End Sub
Right now this procedure works to copy and pastespecial each slide. But all
slides are pasted in the same location and need to be in a 5x4 matrix with
slides sized about 100 High, 120 Wide. Then I need to add the Hyperlink to a
place in the activepresentation to the appropriate slides(backupIndex) that
was just copied.
I know how to do this in the PPT document window wiht the various functions
but I want to be able to run this during slide execution or at least run it
each time a backup slide is added so that the new slide is part of the linked
slides.
Thank you much...I know this isn't an easy problem. I've looked in many
places to find a way to do this but cannot find a command or object commands
to allow me to do this. I also experimented with creating a Dim currentSlide
as slide and couldn't figure out how to modify the needed size/position
parameters or then to paste it in the slide. I don't think the linked slide
possibility exist (or pastespecial) when I do it that was. So the clipboard
.copy and .pastespecial seem like the way to go.
I hope someone can think of a work around or show what I am missing!
Rob
CJ wrote:
Linked Slide Object
13-May-09
I have a PowerPoint 2003 presentation that was given me. It has Quad charts
where 2 of the Quads are linked back to other slides in the presentation. If
you update the full page slides and then right click on the quad and choose
Update Link, the Quad updates.
I can not figure out how this is done so I can duplicate it. When I try to
insert an object - it appears that a New Slide Object can not be linked and
if you try to create a new object from file - you can't insert a presentation
into itself (not to mention how you would go about changing to the actual
slide).
When you look at the Links - the link is shown as the same file name with an
exclamation point and #s behind it.
Any ideas??
Thanks!
EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorials/aspnet/ec832ac7-6e4c-4ea8-81ab-7374d3da34
25/wpf-and-the-model-view-vi.aspx