程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> C#操作mpp文件代碼參考

C#操作mpp文件代碼參考

編輯:C#入門知識

01 using System; 02 using System.Collections.Generic; 03 using System.Text; 04 using Microsoft.Office.Interop.MSProject; 05    06 namespace ConsoleApplication 07 { 08     class Program 09     { 10         static void Main(string[] args) 11         { 12             Program pro = new Program(); 13             pro.readMpp(); 14             // pro.callMacro(); 15             //pro.createMpp(); 16         } 17 //調用mpp中定義的宏 18         public void callMacro() 19         { 20             Object missing = Type.Missing; 21             ApplicationClass prj = new ApplicationClass(); 22 //打開mpp文件 23             prj.FileOpen("C:/Documents and Settings/Administrator/My Documents/test.mpp", 24                 false, missing, missing, missing, missing, missing, missing, missing, 25                 missing, missing, PjPoolOpen.pjPoolReadWrite, missing, missing, missing, missing); 26 //調用名稱為testMacro 27             prj.Macro("testMacro"); 28 //關閉,但不保存mpp

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved