public void TestOpenPowerPointDocument() { OfficeApplicationHelpers.SetTestSettings(1000, 2000, false, false, false, false, false); OfficeApplicationCache officeApplicationCache = new OfficeApplicationCache(); object officeDocument = officeApplicationCache.OpenDocument(CopyFile(Path.Combine(m_testPath, "test.ppt")), false); Assert.IsNotNull(officeDocument); try { if (IsPowerPointVersion11orGreater()) { Assert.IsInstanceOf(typeof(PowerPoint11.Presentation), officeDocument); } else Assert.IsInstanceOf(typeof(PowerPoint.Presentation), officeDocument); } finally { Marshal.ReleaseComObject(officeDocument); } officeApplicationCache.StartTimeout(); }
public void TestOpenExcelDocument() { OfficeApplicationHelpers.SetTestSettings(1000, 2000, false, false, false, false, false); OfficeApplicationCache officeApplicationCache = new OfficeApplicationCache(); object officeDocument = officeApplicationCache.OpenDocument(m_testPath + "test.xls", false); Assert.IsNotNull(officeDocument); try { Assert.IsInstanceOf(typeof(Excel.Workbook), officeDocument); } finally { Marshal.ReleaseComObject(officeDocument); } officeApplicationCache.StartTimeout(); }