private void PublishWithPowerPoint(IDocumentPublisher4 publisher, string sourceFilename, string destinationFilename) { if (null == publisher) return; OfficeApplicationCache officeApplicationCache = OfficeApplicationCache.Instance; object presentation = officeApplicationCache.OpenDocument(sourceFilename, false, FileType.PowerPoint); try { publisher.PublishWithPowerPoint(destinationFilename, presentation); officeApplicationCache.CloseDocument(presentation, false); } finally { Marshal.ReleaseComObject(presentation); } }