今天想做一個MS Project和SolidWorks EPDM整合的項目進度管理,剛開始做規劃,所以很多東西都不會。
希望大家多指點一下,有好的建議和意見都幫忙提一下。
不多說了。
先看Project 檔案的內容吧
下面是讀取任務名稱,開始時間,結束時間。還有其他幾項的代碼。(vb.net)
Public Class OpreateMpp Public Sub ReadMpp() Dim message As String Dim missing As Object = Type.Missing Dim prj As New ApplicationClass prj.FileOpenEx("F:/項目1.mpp", False, missing, missing, missing, missing, missing, missing, missing, missing, missing, PjPoolOpen.pjPoolReadWrite, missing, missing, missing, missing) For Each proj As Project In prj.Projects For Each task As Task In proj.Tasks message = message + "|" + task.Name.ToString + "|" + task.UniqueID.ToString + "|" + task.ResourceNames.ToString + "|" + task.Start.ToString + "|" + task.Finish.ToString + "|" + vbLf Next Next prj.FileClose(PjSaveType.pjSave, False) prj.Quit(PjSaveType.pjSave) System.Console.Read() MsgBox(message) End SubEnd Class