List Properties Methods

Each object can contain one or more properties and methods. When you enter the name of the object in the Code window followed by a period that separates the name of the object from its property or method, a pop-up menu may appear. This menu lists the properties and methods available for the object that precedes the period. To turn on this automated feature, choose Tools | Options. In the Options window, click the Editor tab, and make sure the Auto List Members check box is selected. While entering the VBA instructions, Visual Basic suggests properties and methods that can be used with the particular object, as demonstrated in Figure 2-9.

Figure 2-9: When Auto List Members is selected, Visual Basic suggests properties and methods that can be used with the particular object as you are entering the VBA instructions.

Figure 2-9: When Auto List Members is selected, Visual Basic suggests properties and methods that can be used with the particular object as you are entering the VBA instructions.

To choose an item from the pop-up menu, start typing the name of the property or method you want to use. When the correct item name is highlighted, press Enter to insert the item into your code and start a new line, or press the Tab key to insert the item and continue writing instructions on the same line. You can also double-click the item to insert it in your code. To close the pop-up menu without inserting an item, press Esc. When you press Esc to remove the pop-up menu, Visual Basic will not display the menu for the same object again. To display the properties/methods pop-up menu again, you can: ■ Press Ctrl+J

Use the Backspace key to delete the period, then type the period again Right-click in the Code window, and select List Properties/Methods from the shortcut menu

Part I

Choose Edit | List Properties/Methods

Click the List Properties/Methods button 0 on the Edit toolbar

0 0

Post a comment