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);
}