解决方案 »

  1.   

    代码段如下,获取不到下面的表格内容:
    [___][___][___]
    [___________] //这个获取不到;
    [___][___][___]        for(int p=1;p<=1;p++)
                {
                for(int q=1;q<=columnsCount;q++)
                {
                Dispatch cell = Dispatch.call(processtable, "Cell", new Variant(p), new Variant(q)).toDispatch();
                Dispatch Range=Dispatch.get(cell,"Range").toDispatch();
                String  str= Dispatch.get(Range,"Text").toString();          
                }
                }
      

  2.   

    /** * 获取合并单元格值 * @param sheet * @param row * @param column * @return */ public String getMergedRegionValue(Sheet sheet, int row, int column) { int sheetMergeCount = sheet.getNumMergedRegions(); for (int i = 0; i < sheetMergeCount; i++) { CellRangeAddress ca = sheet.getMergedRegion(i); int firstColumn = ca.getFirstColumn(); int lastColumn = ca.getLastColumn(); int firstRow = ca.getFirstRow(); int lastRow = ca.getLastRow(); if (row >= firstRow && row <= lastRow) { if (column >= firstColumn && column <= lastColumn) { Row fRow = sheet.getRow(firstRow); Cell fCell = fRow.getCell(firstColumn); return getCellValue(fCell); } } } return null; }
      

  3.   

    楼上的是处理excel的吧?好像对word的不适用?不过,还是要谢谢你哈。