Powerpoint Ribbon Problem

K

KennyA

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.ActiveWindow.Presentation.Slides.Range()
ActWinSlidePresentation =
PowerPointAddIn1.Globals.Ribbon2008.Application.ActiveWindow.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
 
S

Shyam Pillai

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
 

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

Similar Threads

VSTO Quesiton 3

Top