A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Powerpoint Ribbon Problem



 
 
Thread Tools Display Modes
  #1  
Old July 15th, 2008, 10:26 AM posted to microsoft.public.powerpoint
KennyA
external usenet poster
 
Posts: 1
Default 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  
Old July 15th, 2008, 04:28 PM posted to microsoft.public.powerpoint
Shyam Pillai
external usenet poster
 
Posts: 622
Default 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  
Old July 15th, 2008, 04:42 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.