Beispiel #1
0
        protected override OfficeDocument Open(System.IO.FileInfo file, String contentid, String rep)
        {
            string filedocxtoOpen = file.FullName;

            if (file.Extension.Equals(HtmlExtension, StringComparison.CurrentCultureIgnoreCase) || file.Extension.Equals(".htm", StringComparison.CurrentCultureIgnoreCase))
            {
                FileInfo docFile = new FileInfo(file.FullName.Replace(file.Extension, ".ppt"));
                if (docFile.Exists)
                {
                    filedocxtoOpen = docFile.FullName;
                }
            }
            PowerPoint.Presentation      presentation   = application.Presentations.Open(filedocxtoOpen, Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
            PowerPoint2007OfficeDocument officeDocument = new PowerPoint2007OfficeDocument(presentation);

            officeDocument.SaveContentProperties(contentid, rep);
            return(officeDocument);
        }
Beispiel #2
0
        private void ActivateDocument(Microsoft.Office.Interop.PowerPoint.Presentation presentation)
        {
            OfficeDocument officeDocument = new PowerPoint2007OfficeDocument(presentation);

            if (officeDocument.IsPublished)
            {
                if (MenuListener != null)
                {
                    OfficeApplication.MenuListener.DocumentPublished();
                }
            }
            else
            {
                if (MenuListener != null)
                {
                    OfficeApplication.MenuListener.NoDocumentPublished();
                }
            }
        }