These two ways allow you to perform any operation that you can perform on a single shape on a range of shapes, whether or not you can perform the same operation in the user interface. In Visual Basic, there are two ways to apply properties and methods to a set of shapes. You can perform other operations with only a single shape selected for example, you can edit the text in a shape only if a single shape is selected. In the user interface, you can perform some operations with several shapes selected for example, you can select several shapes and set all their individual fills at once. Worksheets(1).Shapes(1). = RGB(255, 0, 0)Īpplying a property or method to several shapes at the same time For example, you use the Fill property to return the FillFormat object, and then you set the ForeColor property of the FillFormat object to set the fill foreground color for the specified shape, as shown in the following example. To set properties for a shape, you must first return the object that represents the set of related shape attributes and then set properties of that returned object. Instead, related shape attributes are grouped under secondary objects, such as the FillFormat object, which contains all the properties that relate to the shape's fill, or the LinkFormat object, which contains all the properties that are unique to linked OLE objects. Many formatting properties of shapes are not set by properties that apply directly to the Shape or ShapeRange object. Use to modify multiple shapes the same way you work with multiple shapes in the user interface. Use to create shapes and to iterate through all the shapes on a given worksheet. Shapes, or drawing objects, are represented by three different objects: Object
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |