Excel / VBA:是否有一个形状属性,我可以设置,以防止形状打印?

我写了一些VBA代码来为GUI目的创build一些形状,但是我试图确保这些形状不会被打印出来。 由于我dynamic创build这些形状,我不能手动设置每个形状不能打印。 有没有办法做到这一点编程?

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) ' need a way to set the shape to NOT print...? end with 

 .ControlFormat.PrintObject = False 

蒂姆