示例#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);
            PowerPoint2010OfficeDocument officeDocument = new PowerPoint2010OfficeDocument(presentation);

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

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