DrawingObjects Collection Object

Description

The DrawingObjects collection contains all the graphic objects, controls, ChartObject objects, Picture objects, and OLEObject objects on a sheet. There is no singular DrawingObject object; each member of the DrawingObjects collection is an object of a particular type, such as a CheckBox object, an Arc object, or a Picture object.

Accessors

Use the Add method for the particular object type (Arcs.Add, or Ovals.Add, for example) to create a new graphic object or control and add it to the DrawingObjects collection. There is no Add method for the DrawingObjects collection.

While Picture objects, ChartObject objects, and OLEObject objects are all contained in the DrawingObjects collection, it is usually easier to use the accessor methods for those individual objects. For more information, see the Pictures method, the ChartObjects method, and the OLEObjects method.

Use the DrawingObjects method with no arguments to access the entire collection at once. The following example deletes all DrawingObject objects on the dialog sheet named "Dialog1."


DialogSheets("dialog1").DrawingObjects.Delete

To access a single member of the collection, use the DrawingObjects method with the index number or object name as an argument.

The following example deletes DrawingObject object one on the worksheet named "Sheet1."


Worksheets("sheet1").DrawingObjects(1).Delete

The name of the object is shown in the Name Box when the object is selected. Use the Name property to set or return the name. The following example activates the dialog sheet named "Dialog1" and then changes the text on the buttons named "Button 2" and "Button 3." Note that the Buttons method could have been used where this example uses the DrawingObjects method.


With DialogSheets("dialog1")
    .DrawingObjects("button 2").Text = "On"
    .DrawingObjects("button 3").Text = "Off"
End With

Because the DrawingObjects method returns all members of the collection, regardless of object type, it may be more convenient to use the accessor method for a particular object type. For example, use the Ovals method to return the collection of ovals on the sheet, or the OptionButtons method to return the collection of option buttons. For more information, see the appropriate object topic.

Properties

Accelerator Property, AddIndent Property, Application Property, ArrowHeadLength Property, ArrowHeadStyle Property, ArrowHeadWidth Property, AutoSize Property, Border Property, CancelButton Property, Caption Property, Count Property, Creator Property, DefaultButton Property, DismissButton Property, Display3DShading Property, DisplayVerticalScrollBar Property, DropDownLines Property, Enabled Property, Font Property, Height Property, HelpButton Property, HorizontalAlignment Property, InputType Property, Interior Property, LargeChange Property, Left Property, LinkedCell Property, List Property, ListFillRange Property, ListIndex Property, Locked Property, LockedText Property, Max Property, Min Property, MultiLine Property, MultiSelect Property, OnAction Property, Orientation Property, Parent Property, PhoneticAccelerator Property, Placement Property, PrintObject Property, RoundedCorners Property, Selected Property, Shadow Property, SmallChange Property, Text Property, Top Property, Value Property, VerticalAlignment Property, Vertices Property, Visible Property, Width Property, ZOrder Property.

Methods

AddItem Method, BringToFront Method, Characters Method, CheckSpelling Method, Copy Method, CopyPicture Method, Cut Method, Delete Method, Duplicate Method, Group Method, Item Method, LinkCombo Method, RemoveAllItems Method, RemoveItem Method, Reshape Method, Select Method, SendToBack Method, Ungroup Method.