vba - Apply a picture style to all pictures in a word document -
is there easy way pro-actively or retro-actively apply 'picture style' images stored in word document?
i want apply 'center shadow rectangle' picture style images add document without changing them 1 1.
the picture style concept exists @ ui level. apply image, have check properties of style in ui , apply them 1 one using vba:
sub formatpictures() dim oinlineshape inlineshape each oinlineshape in activedocument.inlineshapes applypicturestyletoinlineshape oinlineshape next dim oshape shape each shape in activedocument.shapes applypicturestyletoshape oshape next end sub sub applypicturestyletoinlineshape(shape inlineshape) ' borders shape.borders.enable = false ' fill shape.fill.visible = msofalse ' line shape.line.visible = msofalse ' shadow shape.shadow.style = msoshadowstyleoutershadow shape.shadow.type = msoshadow21 shape.shadow.forecolor = wdcolor.wdcolorblack shape.shadow.transparency = 0.3 shape.shadow.size = 100 shape.shadow.blur = 15 shape.shadow.offsetx = 0 shape.shadow.offsety = 0 ' reflection shape.reflection.type = msoreflectiontypenone ' glow shape.glow.radius = 0 shape.softedge.radius = 0 end sub sub applypicturestyletoshape(shape shape) ' fill shape.fill.visible = msofalse ' line shape.line.visible = msofalse ' shadow shape.shadow.style = msoshadowstyleoutershadow shape.shadow.type = msoshadow21 shape.shadow.forecolor = wdcolor.wdcolorblack shape.shadow.transparency = 0.3 shape.shadow.size = 100 shape.shadow.blur = 15 shape.shadow.offsetx = 0 shape.shadow.offsety = 0 ' reflection shape.reflection.type = msoreflectiontypenone ' glow shape.glow.radius = 0 shape.softedge.radius = 0 end sub
Comments
Post a Comment