C # operation mpp file code reference

Source: Internet
Author: User

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 // Call the macro defined in mpp 18         public void callMacro() 19         { 20             Object missing = Type.Missing; 21             ApplicationClass prj = new ApplicationClass(); 22 // Open the mpp File 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 // Call testMacro 27             prj.Macro("testMacro"); 28 // Close, but do not save the mpp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.