A method is just a way of telling an object to do something. The Application object, for example, has an AppMinimize method. When you call (or "invoke") the AppMinimize method, you're telling Microsoft Project, represented by the Application object, to minimize its window.

Many methods return information about the results of the action, such as when the AppMinimize method returns a value of True or False to tell you whether Microsoft Project was minimized successfully.

Some methods can accept arguments, which are ways of supplying additional information to the method. The Tasks collection's Add method, for example, has optional Name and Before arguments, so that you can specify a name and position for the new task as you create it. For example, the following code creates a task called "Write chapter" as the third task (the new task is inserted before what was the third task) in a collection of tasks:

ActiveProject.Tasks.Add "Write chapter", 3

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment