开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜