Powerpoint VBA: Clearing shape color -
good day vba experts out there,
i'm trying write code search shape color , position somewhere.
example
if shape.fill.forecolor.rgb = rgb(210, 210, 210) shape .width = 700 .height = 20 .top = 80 .left = 30 .name = "titletextbox" .fill.visible = msofalse .fill.transparency = 1.0 '(somehow when type 1.0 become 1#, not sure why on also) end end if
how use code:
i using code add fill color grey = rgb(210,210,210) shapes clear color , reposition shape wanted
however, when run code again, shape has added grey color reposition again, though doesn't have fill it.
somehow, felt shape has remembered color apply them, isn't wanted.
appreciate if 1 can provide me insight on how can overcome problem.
thanks
try this:
option explicit public sub testme() dim sh shape dim sld slide set sld = application.activewindow.view.slide each sh in sld.shapes if sh.fill.forecolor.rgb = rgb(210, 210, 210) sh .fill.forecolor.rgb = rgb(0, 0, 0) .width = 700 .height = 20 .top = 80 .left = 30 .name = "titletextbox" .fill.visible = msofalse .fill.transparency = 1# end end if next sh end sub
once find grey shape, make sure change color rgb(0,0,0)
. thus, not grey more , not taken account, if run code again. have done line:
.fill.forecolor.rgb = rgb(0, 0, 0)
Comments
Post a Comment