If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Powerpoint Ribbon Problem
Not sure if this is the correct forum. Writting a ribbonbar addin in
vb2008 to change the background of an indivdual slide. This program does it for all slides NOT the SELECTED SLIDES How come? On Error GoTo NoBackgroundFound Dim ActWinSlideRange As Microsoft.Office.Interop.PowerPoint.SlideRange Dim ActWinSlidePresentation As Microsoft.Office.Interop.PowerPoint.Presentation ActWinSlideRange = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation.Slides.Range() ActWinSlidePresentation = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation With ActWinSlideRange .FollowMasterBackground = Microsoft.Office.Core.MsoTriState.msoFalse .DisplayMasterShapes = Microsoft.Office.Core.MsoTriState.msoTrue With .Background .Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue .Fill.ForeColor.RGB = RGB(255, 255, 255) .Fill.BackColor.SchemeColor = PowerPoint.PpColorSchemeIndex.ppShadow .Fill.Transparency = 0.0# If InStr(ActWinSlidePresentation.Name, ".pptm") 0 Then .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".pptm", "") & "\Ultra Background Slide.jpg") Else .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".ppt", "") & "\Ultra Background Slide.jpg") End If End With End With Exit Sub NoBackgroundFound: MsgBox("No Background Found") End Sub |
#2
|
|||
|
|||
Powerpoint Ribbon Problem
Kenny,
ActiveWindow.Presentation.Slides.Range() applies to all the slides in the presentation. Try using: Activewindow.Selection.SlideRange instead. -- Regards, Shyam Pillai Animation Carbon: Copy/Paste/Share animation libraries. www.animationcarbon.com "KennyA" wrote in message ... Not sure if this is the correct forum. Writting a ribbonbar addin in vb2008 to change the background of an indivdual slide. This program does it for all slides NOT the SELECTED SLIDES How come? On Error GoTo NoBackgroundFound Dim ActWinSlideRange As Microsoft.Office.Interop.PowerPoint.SlideRange Dim ActWinSlidePresentation As Microsoft.Office.Interop.PowerPoint.Presentation ActWinSlideRange = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation.Slides.Range() ActWinSlidePresentation = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation With ActWinSlideRange .FollowMasterBackground = Microsoft.Office.Core.MsoTriState.msoFalse .DisplayMasterShapes = Microsoft.Office.Core.MsoTriState.msoTrue With .Background .Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue .Fill.ForeColor.RGB = RGB(255, 255, 255) .Fill.BackColor.SchemeColor = PowerPoint.PpColorSchemeIndex.ppShadow .Fill.Transparency = 0.0# If InStr(ActWinSlidePresentation.Name, ".pptm") 0 Then .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".pptm", "") & "\Ultra Background Slide.jpg") Else .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".ppt", "") & "\Ultra Background Slide.jpg") End If End With End With Exit Sub NoBackgroundFound: MsgBox("No Background Found") End Sub |
#3
|
|||
|
|||
Powerpoint Ribbon Problem
In article , KennyA wrote:
Not sure if this is the correct forum. Writting a ribbonbar addin in vb2008 to change the background of an indivdual slide. This program does it for all slides NOT the SELECTED SLIDES How come? On Error GoTo NoBackgroundFound Dim ActWinSlideRange As Microsoft.Office.Interop.PowerPoint.SlideRange Dim ActWinSlidePresentation As Microsoft.Office.Interop.PowerPoint.Presentation I don't .NET but I'd bet this is your problem: ActWinSlideRange = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation.Slides.Range() You've just set ActWinSlideRange to the entire Slides collection of the presentation. In VBA, you'd work with this instead: [set variable] = ActiveWindow.Selection.SlideRange Translate that back to VB.NET and you should be good to go. ActWinSlidePresentation = PowerPointAddIn1.Globals.Ribbon2008.Application.Ac tiveWindow.Presentation With ActWinSlideRange .FollowMasterBackground = Microsoft.Office.Core.MsoTriState.msoFalse .DisplayMasterShapes = Microsoft.Office.Core.MsoTriState.msoTrue With .Background .Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue .Fill.ForeColor.RGB = RGB(255, 255, 255) .Fill.BackColor.SchemeColor = PowerPoint.PpColorSchemeIndex.ppShadow .Fill.Transparency = 0.0# If InStr(ActWinSlidePresentation.Name, ".pptm") 0 Then .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".pptm", "") & "\Ultra Background Slide.jpg") Else .Fill.UserPicture("C:\My Documents\Powerpoint\Background\" & Replace(ActWinSlidePresentation.Name, ".ppt", "") & "\Ultra Background Slide.jpg") End If End With End With Exit Sub NoBackgroundFound: MsgBox("No Background Found") End Sub ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================ |
Thread Tools | |
Display Modes | |
|
|