T
Tom Asken
Hello,
i would like to color a shape by using it's unique id
I know how to color it:
Public Sub setColorOfShape(oShp As Shape)
zOrderPos = oShp.zOrderPosition
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.Visible =
msoTrue
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.ForeColor.RGB
= RGB(255, 204, 0)
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.OneColorGradient
msoGradientVertical, 2, 0.33
End Sub
I know how to get it's unique id if someone clicked it:
Public Sub getIdOfClickedShape(oShp As Shape)
MsgBox oShp.id
End Sub
I used the macro recorder to see how it colors a shape:
Sub setColorOfShape()
' created from macro recorder
ActiveWindow.Selection.SlideRange.Shapes("Text Box 18").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(0, 204, 255)
.Fill.Transparency = 0#
End With
End Sub
Because the name of a shape ("Text Box 18") and its z-OrderPosition
can change i would like to manipulate it by its unique id.
Like in this Pseudo-Code:
ActivePresentation.Shapes.id(467).Select ' <- this is just an example,
it doesn't work
1) So How do i acces an manipulate a shape by talking / selecting it
via it's ID ?
2) How do i count the number of shapes on the activewindow / slide ?
I found:
Dim sSlide As Slide
MsgBox sSlide.Shapes.Count
but i did not work.
Thanks a lot
Best regards
Tom
i would like to color a shape by using it's unique id
I know how to color it:
Public Sub setColorOfShape(oShp As Shape)
zOrderPos = oShp.zOrderPosition
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.Visible =
msoTrue
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.ForeColor.RGB
= RGB(255, 204, 0)
SlideShowWindows(1).View.Slide.Shapes(zOrderPos).Fill.OneColorGradient
msoGradientVertical, 2, 0.33
End Sub
I know how to get it's unique id if someone clicked it:
Public Sub getIdOfClickedShape(oShp As Shape)
MsgBox oShp.id
End Sub
I used the macro recorder to see how it colors a shape:
Sub setColorOfShape()
' created from macro recorder
ActiveWindow.Selection.SlideRange.Shapes("Text Box 18").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(0, 204, 255)
.Fill.Transparency = 0#
End With
End Sub
Because the name of a shape ("Text Box 18") and its z-OrderPosition
can change i would like to manipulate it by its unique id.
Like in this Pseudo-Code:
ActivePresentation.Shapes.id(467).Select ' <- this is just an example,
it doesn't work
1) So How do i acces an manipulate a shape by talking / selecting it
via it's ID ?
2) How do i count the number of shapes on the activewindow / slide ?
I found:
Dim sSlide As Slide
MsgBox sSlide.Shapes.Count
but i did not work.
Thanks a lot
Best regards
Tom