D
Divyesh
I am in process of writing a script that republishes Project. My problem is
how i can open all the enterpirse projects from the server at one time and
loop through them.
Below is my code. Using "projApp.FileOpenEx()" I am able to open one project
at a time from Project professional and then code saves that project,
republish it and close it. Please let me know if it is possible for me to
open all the project as same time and loop through it so code can save and
republish all project one by one.
Module Module1
Sub Main()
Dim strProj = "http://njcportal/pwa"
Dim projApp As New Microsoft.Office.Interop.MSProject.Application
Dim proj As Microsoft.Office.Interop.MSProject.Project
projApp.FileOpenEx()
Dim cnt
cnt = projApp.Projects.Count
For Each proj In projApp.Projects
'proj = projApp.ActiveProject
'projApp.UpdateProject()
projApp.FileSave()
System.Threading.Thread.Sleep(17000)
projApp.Publish()
System.Threading.Thread.Sleep(17000)
projApp.FileClose(PjSaveType.pjSave)
Next
End Sub
End Module
how i can open all the enterpirse projects from the server at one time and
loop through them.
Below is my code. Using "projApp.FileOpenEx()" I am able to open one project
at a time from Project professional and then code saves that project,
republish it and close it. Please let me know if it is possible for me to
open all the project as same time and loop through it so code can save and
republish all project one by one.
Module Module1
Sub Main()
Dim strProj = "http://njcportal/pwa"
Dim projApp As New Microsoft.Office.Interop.MSProject.Application
Dim proj As Microsoft.Office.Interop.MSProject.Project
projApp.FileOpenEx()
Dim cnt
cnt = projApp.Projects.Count
For Each proj In projApp.Projects
'proj = projApp.ActiveProject
'projApp.UpdateProject()
projApp.FileSave()
System.Threading.Thread.Sleep(17000)
projApp.Publish()
System.Threading.Thread.Sleep(17000)
projApp.FileClose(PjSaveType.pjSave)
Next
End Sub
End Module