public Form1() { InitializeComponent(); Point.Application application = new NetOffice.PowerPointApi.Application(); application.Visible = NetOffice.OfficeApi.Enums.MsoTriState.msoTrue; NetOffice.PowerPointApi.Tools.Utils.CommonUtils utils = new Point.Tools.Utils.CommonUtils(application); string hwnd1 = utils.Application.HWND.ToString(); string hwnd2 = application.HWND.ToString(); Console.WriteLine(hwnd1); Console.WriteLine(hwnd2); //application.Quit(); //application.Dispose(); }
public Form1() { InitializeComponent(); Point.Application application = new NetOffice.PowerPointApi.Application(); application.Visible = NetOffice.OfficeApi.Enums.MsoTriState.msoTrue; NetOffice.PowerPointApi.Tools.Utils.CommonUtils utils = new Point.Tools.Utils.CommonUtils(application); string hwnd1 = utils.Application.HWND.ToString(); string hwnd2 = application.HWND.ToString(); Console.WriteLine(hwnd1); Console.WriteLine(hwnd2); //application.Quit(); //application.Dispose(); }
private static void TestPowerPoint() { Console.WriteLine("Test PowerPoint Application Utils"); PowerPoint.Application application = new PowerPoint.Application(); application.Visible = NetOffice.OfficeApi.Enums.MsoTriState.msoTrue; application.Presentations.Add(); PowerPoint.Tools.Utils.CommonUtils utils = new PowerPoint.Tools.Utils.CommonUtils(application); int hwnd = utils.Application.HWND; application.Quit(); application.Dispose(); if (0 == hwnd) { throw new Exception("Cant resolve powerpoint hwnd"); } }
private static void TestPowerPoint() { Console.WriteLine("Test PowerPoint Application Utils"); PowerPoint.Application application = new PowerPoint.Application(); application.Visible = NetOffice.OfficeApi.Enums.MsoTriState.msoTrue; application.Presentations.Add(); PowerPoint.Tools.Utils.CommonUtils utils = new PowerPoint.Tools.Utils.CommonUtils(application); int hwnd = utils.Application.HWND; application.Quit(); application.Dispose(); if (0 == hwnd) throw new Exception("Cant resolve powerpoint hwnd"); }