如何使用aspose从Excel文件的oleObject获取带有扩展名的文件名?

问题描述

我正在尝试使用aspose单元从excel文件中获取ole对象的文件名。 对于大多数文件,我可以使用getSourceFullName()来获取。 我什至尝试了其他与文件名有关的方法。 在特定情况下,getSourceFullName()为null。但是二进制数据仍然存在,如果知道extn,我可以为其创建文件。

这是我的代码段:

// Loop through all the ole objects and extract each object. in the worksheet.
        for (int i = 0; i < oles.getCount(); i++) {
            if (oles.get(i).getMsoDrawingType() == MsoDrawingType.OLE_OBJECT) {
                OleObject ole = (OleObject) oles.get(i);

                String sRow=""+ole.getActualLowerRightRow();
                //Cell cells = workbook.getWorksheets().get(0).getCells().getCell(ole.getActualLowerRightRow(),26);
                //System.out.println(ole.getPlacement());
                //System.out.println(ole.getLinkedCell());
                String sOrgFile=ole.getSourceFullName();

                //System.out.println(   ole.getZOrderPosition());
                //System.out.println(ole.getId());
                if(sOrgFile == null) //This code is only skipping those file with null resourceFullNme. 
                {
                    continue;//this is to handle the issue that resoirceFull name is NULL for certain embedded file.
                }


                String sFnamme= new File(sOrgFile).getName();

我得到除文件名以外的所有其他信息。 有人可以帮我吗?

先谢谢了。 -Swapnil

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)