本文整理汇总了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();
}
示例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;
}
示例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;
}
}