Excel/VBA: Is there a shape property I can set to prevent the shape from printing?
I wrote some VBA code to create some shapes for GUI purposes, but I am trying to make sure the shapes won't print. Since I am creating these shapes dynamically, I can't manually set each shape to not print. Is there a way to do it programmatically?
Set roundedRec = ws.Shapes.AddShape(msoShapeRectangle, 10, 10, 10, 10)
roundedRec.Name = shapeName
With roundedRec
.Fill.Visible = msoFalse
.Line.ForeColor.RGB = RGB(0, 204, 0)
.Line.Style = msoLineThinThin
.Width = target.Width + 4
.Left = target.Left - 2
.Height = target.Height + 4
.Top = target.Top - 2
.ZOrder (msoSendToBack)开发者_Go百科
' need a way to set the shape to NOT print...?
end with
.ControlFormat.PrintObject = False
Tim
精彩评论