PowerPoint 2007 Shapes.Paste

S

stricky

Hi,

I have been converting our office VB6 Programs to use Office 2007.

One of Our Applications uses powerpoint to display information
transferred from a RTF document. Upon Attempting to Paste onto a slide
i have issues.

When you Paste the Normal Way using
ActiveDocument.Slides(ActiveDocument.Slides.Count).Paste the content
of the Clipboard is pasted for the First Slide only.

When you use this method to paste to the second slide you get a Object
not recognised error for Shapes. In This Context the PasteSpecial
Command does not work either.

To get this to work i Needed to add a Shape to the Slide to initialise
the Slide Shapes Object, Then Paste is still not available but
PasteSpecial Is.
From a Developers perspective this is very irratating as the option is
available via IntelliSense but it does not work.

regards,

Stuart Dodd BSc
 
S

stricky

Appologies, Yeah the code above should not work should be

ActivePresentation.Slides(ActivePresentation.Slides.Count).Shapes.Paste

the paste opewration is to place a complex drawing object that has
been Grouped.

Which produces the error in VBA, and when set to a Slide object in VB6
the error also appears.

regards,

Stu
 
S

stricky

oTemp.Content.WholeStory
oTemp.Content.ShapeRange.Select
If (iCount Mod 50) = 0 Then
oPresentation.Close
Set oPresentation = m_objPPT.Presentations.Add
oPresentation.PageSetup.SlideHeight =
oDoc.PageSetup.PageHeight
oPresentation.PageSetup.SlideWidth =
oDoc.PageSetup.PageWidth
oPresentation.PageSetup.SlideOrientation =
oDoc.PageSetup.Orientation
oPresentation.SaveAs Replace(m_sRtfPath, ".rtf", "_" &
iCount & ".ppt")
ReDim Preserve
aryPresentations(UBound(aryPresentations) + 1)
aryPresentations(UBound(aryPresentations)) =
Replace(m_sRtfPath, ".rtf", "_" & iCount & ".ppt")
'Set oPresentation =
m_objPPT.Presentations.Open(Replace(m_sRtfPath, ".rtf", ".ppt"))
End If
m_objWord.Selection.ShapeRange.Group
oTemp.UndoClear
With oTemp
.Content.ShapeRange.Select
End With
'oTemp.ActiveWindow.View.ShowDrawings = True
If iCount <> 1 Then m_objWord.Selection.WholeStory

Clipboard.Clear
m_objWord.Selection.Cut

'# Add picture to a new slide in the presentation
Set oSlide =
oPresentation.Slides.Add(oPresentation.Slides.Count + 1,
ppLayoutBlank)
oSlide.Name = "Page : " & iCount
oSlide.Select

oSlide.Shapes.Paste

The last line is the issue, Though i did find a way round it it's not
pleasant so would appreciate a way round it.

I can't paste any more than this. Like i said before the Word document
id a drawing object with a complex drawing per page.

Stu
 
S

stricky

hi steve,

had already tried this approach and it only works for the first slide
in the presentation as soon as you move to the second slide the
Shapes.Paste line does not work.

regards,

Stu
 
S

stricky

Thanks Anyway Steve,

FYI the workaround i have developed is to

If oPresentation.Slides.Count = 1 Then
oSlide.Shapes.Paste
Else
oSlide.Shapes.AddShape(msoShape10pointStar, 10, 10, 50, 50).Select
oSlide.Shapes.PasteSpecial ppPasteMetafilePicture
End If

If iCount <> 1 Then
oPresentation.Slides(oPresentation.Slides.Count).Shapes(1).Delete
End If

I have to paste as a metafile picture so the picture can be broken
apart the same as a complex drawing object that has been grouped.

hope this helps if anyone else comes accross this issue.

Regards,

Stuart Dodd BSc
 

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