本文整理汇总了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);
}
示例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>());
}
示例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
}
示例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);
}