![]() |
#1
|
|||
|
|||
![]()
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 |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
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 |
![]() |
deaton | Office | 4 | 03-05-2010 07:27 AM |
Word only pastes plain text | seskanda | Word | 6 | 02-19-2010 10:01 AM |
![]() |
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 |