Creating Projects

The Projects table on the Schedule object contains all the project information. Projects are used for organizing tasks. After creating a project, you can link tasks to it. Tasks linked to a project can be thought of as belonging to that project.

    To create a project
  1. Get the Projects table from the global Schedule object.
  2. Use the New method to create a new item in the Projects table.
  3. Set the desired properties on the item.
  4. Release the objects.

The following sample code retrieves the Project table from the global Schedule object and then creates a new project:

Public Sub CreateProject()
    Dim objTable As Object
    Dim objItem As Object
    
    'Get the Projects table from the global Schedule object.
    Set objTable = objSchedule.Projects
    
    'Create a new item in the Projects table.
    Set objItem = objTable.New
    
    'Set the desired properties on the item.
    objItem.SetProperties Text:="Home Improvement", Priority:=LConvertTo32bitPriority("A5")
    
    'Release the objects.
    Set objItem = Nothing
    Set objTable = Nothing
End Sub