W
Wicked Wizard
I need a little bit of code you'd think was dead simple but I cannot make it
work...
WinXP Pro, PPT 2000
I want to create some shapes on a page at the touch of a button.
The macro reads:
Sub addSomeShapes()
Dim leftPosition As Single
Dim topPosition As Single
Dim width As Single
Dim height As Single
Dim i As Integer
leftPosition = 130
topPosition = 250
width = 50
height = 50
i = 1
For i = 1 To 4
ActivePresentation.Slides(4).Shapes.AddShape(msoShape5pointStar,
leftPosition, topPosition, width, height).Fill.ForeColor.RGB = RGB(128, 0,
0)
leftPosition = leftPosition + 125
Next i
End Sub
I get the shapes, but I do not get the fill colour. I've tried creating the
shapes, selecting them and setting colour, with no luck. I have battled it
for nearly 2 hrs and now need a little help.
Incidentally I always get trouble using RGB values.
On another slide I have a shape and change the fill but always have to use
vbRed, etc rather than RGB values. So I know I've not got hold of
someething properly. But in the example above neither solution works.
PLEASE!
WW
work...
WinXP Pro, PPT 2000
I want to create some shapes on a page at the touch of a button.
The macro reads:
Sub addSomeShapes()
Dim leftPosition As Single
Dim topPosition As Single
Dim width As Single
Dim height As Single
Dim i As Integer
leftPosition = 130
topPosition = 250
width = 50
height = 50
i = 1
For i = 1 To 4
ActivePresentation.Slides(4).Shapes.AddShape(msoShape5pointStar,
leftPosition, topPosition, width, height).Fill.ForeColor.RGB = RGB(128, 0,
0)
leftPosition = leftPosition + 125
Next i
End Sub
I get the shapes, but I do not get the fill colour. I've tried creating the
shapes, selecting them and setting colour, with no luck. I have battled it
for nearly 2 hrs and now need a little help.
Incidentally I always get trouble using RGB values.
On another slide I have a shape and change the fill but always have to use
vbRed, etc rather than RGB values. So I know I've not got hold of
someething properly. But in the example above neither solution works.
PLEASE!
WW