Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2011, 03:28 PM
matt.wilson matt.wilson is offline Help with PPT AddIn that pastes slides into another presentation Windows 7 32bit Help with PPT AddIn that pastes slides into another presentation Office 2010 32bit
Novice
Help with PPT AddIn that pastes slides into another presentation
 
Join Date: Jan 2011
Posts: 1
matt.wilson is on a distinguished road
Default Help with PPT AddIn that pastes slides into another presentation

Hi



We have a small PPT addin which works fine on Office 2003 but for some reason doesn't quite work in PPT 2010. What the AddIn does is opens a 'template' presentation (TheFileName), copies the relevant slide (theslide) onto the clipboard, closes the template presentation & then pastes the slide into the original presentation. This works fine in PPT 2003 but when run in 2010 the copy & paste function works fine but then the ribbon becomes unresponsive (until you flick to another application on the taskbar & then back). Also, if you try run the AddIn again the form which the user uses to select which slide they want to insert is completely blank which suggests to me that the AddIn never seems to finish what its doing.

This is the code I'm using:

Sub insertSlide(theFile As String, theSlide As Integer)

Dim TheFileName As String
TheFileName = "C:\Optimisa_PPT_Toolbar\Content\files\" & theFile

Presentations.Open FileName:=TheFileName
ActivePresentation.Slides(theSlide).Copy

With Application.Presentations(TheFileName)
.Saved = True
.Close
End With

If PowerPoint.Application.Version >= 9 Then
'window must be visible
PowerPoint.Application.Visible = msoTrue
End If

On Error GoTo PROC_ERR

ActiveWindow.View.Paste

PROC_ERR:
If Err = "-2147188160" Then

Dim ppApp As PowerPoint.Application
Set ppApp = CreateObject("Powerpoint.Application")

' Make it visible.
ppApp.Visible = True

' Add a new presentation.
Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Add(msoTrue)

' Add a new slide.
Dim ppSlide1 As PowerPoint.Slide
Set ppSlide1 = ppPres.Slides.Add(1, ppLayoutText)

ActiveWindow.View.Paste

End If
End Sub

Any ideas as to why this works with PPT 2003 but seems to throw up some random problems (Ribbon freezing & unable to run AddIn again) in PPT 2010 would be much appreciated.

Thanks

Matt
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling Style when a user pastes into a form Cris0205 Word 0 08-05-2010 04:33 PM
Help with PPT AddIn that pastes slides into another presentation Save as PDF addin deaton Office 4 03-05-2010 07:27 AM
Word only pastes plain text seskanda Word 6 02-19-2010 10:01 AM
Help with PPT AddIn that pastes slides into another presentation viewing slides while doing my presentation davepower PowerPoint 1 04-30-2009 02:18 PM
How many slides in a 30 min presentation barbara3010 PowerPoint 2 02-12-2009 10:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft