Hi,
I have form that displays a presentation on click of a button. Please find code below
public partial class Form1 : Form { Microsoft.Office.Interop.PowerPoint.Application PowerPointApp = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Microsoft.Office.Interop.PowerPoint.Presentation presentation = null; PowerPointApp = new Microsoft.Office.Interop.PowerPoint.Application(); PowerPointApp.Visible = MsoTriState.msoTrue; presentation = (Microsoft.Office.Interop.PowerPoint.Presentation)PowerPointApp.Presentations.Open(@"c:\hello.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoTrue); //PowerPoint.PpWindowState originalWindowState = PowerPointApp.WindowState; //PowerPointApp.WindowState = Microsoft.Office.Interop.PowerPoint.PpWindowState.ppWindowMinimized; //PowerPointApp.WindowState = originalWindowState; DocumentWindow doc = presentation.Windows[1]; Microsoft.Office.Interop.PowerPoint.PpWindowState originalWindowState = doc.WindowState; doc.WindowState = Microsoft.Office.Interop.PowerPoint.PpWindowState.ppWindowMinimized; doc.WindowState = originalWindowState; doc.Activate(); }
In Office 2007, If I have an external Power Point opened in my machine, Some times the external power point is going off by running this code. And always the opened power point is in minimized mode.
I am trying to minimize and later restoring the powerpoint since I want it to come in forground. This is working with Office 2010 but fails with Office 2007