当前位置: 首页>>代码示例>>C#>>正文


C# Presentation.Close方法代码示例

本文整理汇总了C#中Presentation.Close方法的典型用法代码示例。如果您正苦于以下问题:C# Presentation.Close方法的具体用法?C# Presentation.Close怎么用?C# Presentation.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Presentation的用法示例。


在下文中一共展示了Presentation.Close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestAppend

        /*
        private void TestAppend()
        {
            mi_App = new Microsoft.Office.Interop.PowerPoint.Application();
            mi_Pres1 = mi_App.Presentations.Open(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File1.pptx",
                MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
            mi_Pres2 = mi_App.Presentations.Open(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File2.pptx",
                MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);

            for (int i = 1; i <= mi_Pres2.Slides.Count; i++)
            {
                mi_Pres2.Slides[i].Copy();
                mi_Pres1.Slides.Paste(mi_Pres1.Slides.Count+1);
                mi_Pres1.Slides[mi_Pres1.Slides.Count].FollowMasterBackground = MsoTriState.msoFalse;
            }
            mi_Pres1.SaveAs(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File3.pptx",
                PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoTrue);
            mi_Pres1.Close();
            mi_Pres2.Close();

        }
        */
        private void AppendFile(string file)
        {
            mi_Pres2 = mi_App.Presentations.Open(file, MsoTriState.msoFalse,
                MsoTriState.msoFalse, MsoTriState.msoFalse);
            for (int i = 1; i <= mi_Pres2.Slides.Count; i++)
            {
                mi_Pres2.Slides[i].Copy();
                mi_Pres1.Slides.Paste(mi_Pres1.Slides.Count + 1);
                mi_Pres1.Slides[mi_Pres1.Slides.Count].FollowMasterBackground = MsoTriState.msoFalse;
            }
            mi_Pres2.Close();
        }
开发者ID:solegaonkar,项目名称:Play-With-PPT,代码行数:34,代码来源:JoinPpt.cs

示例2: quitPresentation

        public void quitPresentation(Presentation presentation)
        {
            //Reenable Office Assisant, if it was on:
              if (this.powerpoint == null) return;
              if (this.powerpoint.Presentations.Count == 0) return;
              if (presentation == null) return;

              //if (this.bAssistantOn)
              //{
              //  this.powerpoint.Assistant.On = true;
              //  this.powerpoint.Assistant.Visible = false;
              //}
              presentation.Close();
              if (presentation == this.presentation) this.presentation = null;
        }
开发者ID:dwickeroth,项目名称:covise,代码行数:15,代码来源:PowerPoint.cs

示例3: Button_Save_Click

 private void Button_Save_Click(object sender, EventArgs e)
 {
     string[] files = Text_InputFiles.Text.Split("\r\n".ToCharArray(),
         StringSplitOptions.RemoveEmptyEntries);
     foreach (string file in files)
     {
         FileInfo F = new FileInfo(file);
         if (!F.Exists)
         {
             MessageBox.Show("File does not exist " + file, "File Not Found",
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         if (F.Extension.ToLower() != ".ppt" && F.Extension.ToLower() != ".pptx")
         {
             MessageBox.Show("This is not a ppt/pptx " + file, "Not PPT/PPTX",
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
     }
     if (DialogResult.OK == SaveFile.ShowDialog())
     {
         Cursor.Current = Cursors.WaitCursor;
         mi_Pres1 = (Presentation)mi_App.Presentations.Add(MsoTriState.msoFalse);
         foreach (string file in files)
         {
             AppendFile(file);
         }
         mi_Pres1.SaveAs(SaveFile.FileName,
             PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoFalse);
         mi_Pres1.Close();
         Cursor.Current = Cursors.Default;
     }
 }
开发者ID:solegaonkar,项目名称:Play-With-PPT,代码行数:34,代码来源:JoinPpt.cs


注:本文中的Presentation.Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。