Hi,
When embedding ole object in to a document the [IconCaption] is not being set on OleFormat object. Is there a workaround?
void Main()
{
var doc = new Aspose.Words.Document();
var builder = new DocumentBuilder(doc);
builder.MoveToDocumentEnd();
foreach(var file in Directory.GetFiles("C:\Downloads"))
{
var icon = Icon.ExtractAssociatedIcon(file);
var ext = Path.GetExtension(file).ToLower();
var progid = "Package";
switch (ext)
{
case ".xls":
progid = "Excel.Sheet.8";
break;
case ".xlsx":
progid = "Excel.Sheet.12";
break;
case ".pdf":
progid = "Package";
break;
case ".doc":
progid = "Word.Document.8";
break;
case ".docx":
progid = "Word.Document.12";
break;
}
using(var bmp = icon.ToBitmap())
{
var shape = builder.InsertOleObject(file, false, true, bmp);
}
}
doc.Save(@"C:\Publish\out.docx");
}