C#控制PPT在放映模式下的显示和隐藏

http://blog.csdn.net/luols/article/details/7898853

 

PPT在放映模式下貌似没有显示和隐藏功能,不知是我没找到还是确实没有,这不重要,即使真的没有,我们可以用下面的方法来实现该功能

[csharp] view plaincopyprint?
 
  1. using PowerPoint=Microsoft.Office.Interop.PowerPoint;  
  2.   
  3.         bool pptVisible = true;  
  4.         PowerPoint.Application PPApp;  
  5.   
  6.         /// <summary>  
  7.         /// 显示/隐藏 PPT幻灯片  
  8.         /// </summary>  
  9.         /// <param name="sender"></param>  
  10.         /// <param name="e"></param>  
  11.         private void btnShowOrHidePPT_Click(object sender, EventArgs e)  
  12.         {  
  13.             if (pptVisible)  
  14.             {  
  15.                 PPApp.ActivePresentation.SlideShowWindow.Top = 3000; //移到不可见的位置  
  16.             }  
  17.             else  
  18.             {  
  19.                 PPApp.ActivePresentation.SlideShowWindow.Top = 0;  
  20.                 PPApp.ActivePresentation.SlideShowWindow.Activate(); //需重新激活,否则会跑到下层  
  21.             }  
  22.             pptVisible = !pptVisible;  
  23.         }  

posted on 2014-05-04 09:58  okgogo2000  阅读(366)  评论(0)    收藏  举报