当前位置: 首页>>代码示例>>C#>>正文


C# DocumentBuilder.InsertOleObject方法代码示例

本文整理汇总了C#中DocumentBuilder.InsertOleObject方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentBuilder.InsertOleObject方法的具体用法?C# DocumentBuilder.InsertOleObject怎么用?C# DocumentBuilder.InsertOleObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocumentBuilder的用法示例。


在下文中一共展示了DocumentBuilder.InsertOleObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertOleObject

 public static void InsertOleObject(string dataDir)
 {
     // ExStart:DocumentBuilderInsertOleObject
     Document doc = new Document();
     DocumentBuilder builder = new DocumentBuilder(doc);
     builder.InsertOleObject("http://www.aspose.com", "htmlfile", true, true, null);
     dataDir = dataDir + "DocumentBuilderInsertOleObject_out.doc";
     doc.Save(dataDir);
     // ExEnd:DocumentBuilderInsertOleObject
     Console.WriteLine("\nOleObject using DocumentBuilder inserted successfully into a document.\nFile saved at " + dataDir);
 }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:11,代码来源:DocumentBuilderInsertElements.cs

示例2: InsertOleObjectException

        public void InsertOleObjectException()
        {
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            Assert.That(() => builder.InsertOleObject("", "checkbox", false, true, null), Throws.TypeOf<ArgumentException>());
        }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:7,代码来源:ExDocumentBuilder.cs

示例3: InsertOleObjectEx

        public void InsertOleObjectEx()
        {
            //ExStart
            //ExFor:DocumentBuilder.InsertOleObject(String, Boolean, Boolean, Image)
            //ExSummary:Shows how to insert an OLE object into a document.
            Aspose.Words.Document doc = new Aspose.Words.Document();
            DocumentBuilder builder = new DocumentBuilder(doc);
            Image representingImage = Image.FromFile(MyDir + "Aspose.Words.gif");
            Shape oleObject = builder.InsertOleObject(MyDir + "Document.Spreadsheet.xlsx", false, false, representingImage);

            // Double click on the image in the .doc to see the spreadsheet.
            doc.Save(MyDir + @"Document.InsertedOleObject.doc");
            //ExEnd
        }
开发者ID:animaal,项目名称:Aspose_Words_NET,代码行数:14,代码来源:ExDocumentBuilder.cs

示例4: InsertOleObjectEx

        public void InsertOleObjectEx()
        {
            //ExStart
            //ExFor:DocumentBuilder.InsertOleObject(String, Boolean, Boolean, Image)
            //ExFor:DocumentBuilder.InsertOleObject(String, String, Boolean, Boolean, Image)
            //ExSummary:Shows how to insert an OLE object into a document.
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);
            
            Image representingImage = Image.FromFile(MyDir + "Aspose.Words.gif");
            
            Shape oleObject = builder.InsertOleObject(MyDir + "Document.Spreadsheet.xlsx", false, false, representingImage);
            Shape oleObjectProgId = builder.InsertOleObject("http://www.aspose.com", "htmlfile", true, true, null);

            // Double click on the image in the .doc to see the spreadsheet.
            // Double click on the icon in the .doc to see the html.
            doc.Save(MyDir + @"\Artifacts\Document.InsertedOleObject.doc");
            //ExEnd

            //ToDo: There is some bug, need more info for this (breaking html link)
            //Shape oleObjectProgId = builder.InsertOleObject("http://www.aspose.com", "htmlfile", true, false, null);
        }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:22,代码来源:ExDocumentBuilder.cs


注:本文中的DocumentBuilder.InsertOleObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。