![]() For example, assume that you add a check box to a sheet and that both the default shape name and the default code name are CheckBox1. However, when you return a control from the Shapes or OLEObjects collection for a sheet, you must use the shape name, not the code name, to refer to the control by name. You use the code name of a control in the names of its event procedures. However, if you change either the shape name or code name, the other isn't automatically changed to match. When you first add a control to a sheet, the shape name and code name match. (Array(1, 3)).Fill.Patterned _Īn ActiveX control on a sheet has two names: the name of the shape that contains the control, which you can see in the Name box when you view the sheet, and the code name for the control, which you can see in the cell to the right of (Name) in the Properties window. The following example sets the fill pattern for shapes one and three on myDocument. Use Range ( index), where index is the shape's name or index number or an array of shape names or index numbers, to return a ShapeRange collection that represents a subset of the Shapes collection. MsoGradientHorizontal, 1, msoGradientBrass ![]() ![]() MyDocument.Shapes(1).Fill.PresetGradient _ The following example sets the fill to a preset shade for shape one on myDocument. ![]() Use Shapes ( index), where index is the shape's name or index number, to return a single Shape object. If you want to do something (like delete or set a property) to all the shapes on a sheet at the same time, select all the shapes, and then use the ShapeRange property on the selection to create a ShapeRange object that contains all the shapes on the sheet, and then apply the appropriate property or method to the ShapeRange object. ![]()
0 Comments
Leave a Reply. |