Working with Multiple Properties or Methods

Because most objects have many different properties and methods, you'll often need to perform multiple actions on a single object. This is accomplished easily with multiple statements that set the appropriate properties or run the necessary methods. However, this can be a pain if you have a long object name.

For example, take a look at the FormatParagraph procedure shown in Listing 5.1. This procedure uses six statements to format a paragraph. Note that the Paragraph object name— ThisDocument.Paragraphs(1)—is quite long and is repeated in all six statements.

0 0

Post a comment