当前位置:编程学习 > C#/ASP.NET >>

C#操作mpp文件代码参考

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
补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,