Publish to TFS via VBA Macro in Project Pro 2003
-
Monday, March 20, 2006 3:31 PM
I need to write a macro to publish to Team Foundation Server (TFS) from Project Pro 2003. I have to code to publish to Project Server, but I want to create a macro that will publish to the TFS.
I have attempted to record this using Project's Macro Recorder, but it fails to record the click event of the "Publish" button from either the Team tool bar or the Team menu bar
Thanks in advance.
Doug
"Art for your soul"
Answers
-
Thursday, March 30, 2006 5:34 PM
Hi Doug,
Yes, a macro recorder won't record the publish button click, it will only record the changes made to the project plan. You will need to manually create this macro. Here's an example:
Function refresh()
'Find the 'refresh' button.
Dim refreshButton As CommandBarControl
Set refreshButton = Application.CommandBars.FindControl(Tag:="IDC_REFRESH")If refreshButton.Enabled Then
refreshButton.Execute
Else
MsgBox "Refresh button not enabled!"
End IfEnd Function
Function publish()'Find the 'publish' button.
Dim publishButton As CommandBarControl
Set publishButton = Application.CommandBars.FindControl(Tag:="IDC_SYNC")If publishButton.Enabled Then
publishButton.Execute
Else
MsgBox "Publish button not enabled!"
End IfEnd Function

