Powerpoint VBA: Clearing shape color

Viewed 5482

Good day to VBA experts out there,

I'm trying to write a code that search a shape color and then position it into somewhere.

example

If shape.Fill.ForeColor.RGB = RGB(210, 210, 210) Then 

With shape
        .Width = 700 
        .Height = 20
        .Top = 80
        .Left = 30
        .Name = "TitleTextBox"
        .Fill.Visible = msoFalse
        .Fill.Transparency = 1.0  '(somehow when I type 1.0 it will become 1#, not sure why on this also)
End With

End if

How I use my code:

I using this code to add a fill color Grey = RGB(210,210,210) to certain shapes then clear the color and reposition the shape to where I wanted

However, when I run this code again, the shape that has added the Grey color will get reposition again, even though it doesn't have any fill to it.

Somehow, I felt the shape has remembered the color apply to them, which isn't what I wanted.

Appreciate if any one can provide me some insight on how I can overcome this problem.

Thanks

1 Answers
Related