Methods of a Comment object

Table 7-2 shows the methods that you can use with a Comment object. Again, these methods perform common operations that you may have performed manually with a comment at some point . . . but you probably never thought of these operations as methods.


Method Description

Delete Deletes a comment

Next Returns a Comment object that represents the next comment

Previous Returns a Comment object that represents the previous comment

Text Returns or sets the text in a comment (takes three arguments)

You might be surprised to see that Text is a method rather than a property. This leads to an important point: The distinction between properties and methods isn't always clear-cut, and the object model isn't perfectly consistent. In fact, it's not really important that you distinguish between properties and methods. As long as you get the syntax correct, it doesn't matter whether a word in your code is a property or a method.

Was this article helpful?

0 0

Post a comment