none
Project Professional - Sync to Task List URL accessible via VBA OM? RRS feed

  • Question

  • Hi,

    Is the URL or task list that a Project schedule sync'd to a SharePoint task list accessible via the Object model?  I have had a look through the SDK but can't seem to see any reference to it? 

    Any help gratefully received.

    thanks,

    alex.

    Alex Burton www.epmsource.com
    Saturday, February 20, 2010 3:18 AM
    Moderator

Answers

  • There is not a complete set of objects and members in the Project VBA OM to get all the information you might want. There are a few other members, such as DeliverablesGetByProject. Here is an example of its use (this is for a project published to Project Server, not for a synchronized SharePoint list):

    Sub TestDeliverables()
        Dim projectGuid As String
        Dim ds As Object
        
        projectGuid = ActiveProject.GetServerProjectGuid
            
        Set ds = ActiveProject.DeliverablesGetByProject(projectGuid)
        
        Debug.Print ds.XML
    End Sub

    If you set a deliverable and publish a project, the returned XML string contains a lot of information about the SharePoint URL, list data, and fields for the deliverables list in the project site (workspace). In fact, to write the VBA code to parse the 17,000 + characters returned is a big chore.

    Other VBA methods, such as OpenServerPage, can open various pages in PWA and in the project site. However, you would do much better to develop a VSTO add-in using Visual Studio 2010. Besides much more easily processing the XML in the example above using Linq, in the add-in, you can use GetServerProjectGuid, and then have available all of the PSI and SharePoint OM -- such as the WssInterop service with the ReadProjectSiteBaseUrls and ReadWssServerInfo methods.

    --Jim
    Tuesday, February 23, 2010 4:28 AM

All replies

  • See SynchronizeWithSite in VBA Help:

    "Synchronizes a local project with a tasks list on a Microsoft SharePoint Server 2010 site. The SynchronizeWithSite method is available for a local project in Microsoft Project Professional 2010 only, when you are not logged onto a Project Server account."

    See also ManageSiteColumns.

    --Jim
    Saturday, February 20, 2010 6:10 AM
  • Thanks Jim,

    I am more after a property that exposes what the URL or List name is that a Project has been synchronised with. The SynchroniseWithSite and ManageSiteColumns methods just perform the function and let the values to be set. 

    Sorry if this is an obvious question, I am new to the wonderful world of VBA :)

    Alex.

    Alex Burton www.epmsource.com
    Sunday, February 21, 2010 4:49 AM
    Moderator
  • There is not a complete set of objects and members in the Project VBA OM to get all the information you might want. There are a few other members, such as DeliverablesGetByProject. Here is an example of its use (this is for a project published to Project Server, not for a synchronized SharePoint list):

    Sub TestDeliverables()
        Dim projectGuid As String
        Dim ds As Object
        
        projectGuid = ActiveProject.GetServerProjectGuid
            
        Set ds = ActiveProject.DeliverablesGetByProject(projectGuid)
        
        Debug.Print ds.XML
    End Sub

    If you set a deliverable and publish a project, the returned XML string contains a lot of information about the SharePoint URL, list data, and fields for the deliverables list in the project site (workspace). In fact, to write the VBA code to parse the 17,000 + characters returned is a big chore.

    Other VBA methods, such as OpenServerPage, can open various pages in PWA and in the project site. However, you would do much better to develop a VSTO add-in using Visual Studio 2010. Besides much more easily processing the XML in the example above using Linq, in the add-in, you can use GetServerProjectGuid, and then have available all of the PSI and SharePoint OM -- such as the WssInterop service with the ReadProjectSiteBaseUrls and ReadWssServerInfo methods.

    --Jim
    Tuesday, February 23, 2010 4:28 AM