Hello Aspose Team,
I am trying to add Ole object in Word output using Aspose Word (java) library, using version of insertOleObject which accepts input stream. See below code.
InputStream spreadsheetStream = new FileInputStream(“C:\TaskTracker\7.0.1\ole\” + “sheet1.xlsx”);
docBuilder.writeln(“Spreadsheet Ole object:”);
docBuilder.insertOleObject(spreadsheetStream, “MyOleObject.xlsx”, false, null);
In the output word file, on clicking on the OLE icon i get the error “Office has blocked access to following embedded object to keep you safe” “unknown”. see screen shot attached. blocked_access.PNG (41.2 KB)
When i right click on the icon and try to save the ole on desktop, it saves as “unknown” file. If rename and provide correct extension “xlsx” then that temporary desktop file opens.
I tried the other version of insertOleOjbect function, which takes filepath instead of stream and it was working fine. e.g
File file = new File(“C:\TaskTracker\7.0.1\ole\” + “sheet1.xlsx”);
docBuilder.insertOleObject(file.getAbsolutePath(), false, false, null);
Please help me on why i am getting “blocked access…” error on using InputStream of file instead of file name.
Regards,
Zeeshan Khan
IBM Engineering Lifecycle Optimization - Publishing.