Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Know You Have Vertical Cells Merged
Message
From
20/03/2005 14:46:15
 
 
To
09/03/2005 17:10:02
General information
Forum:
Microsoft Office
Category:
Word
Miscellaneous
Thread ID:
00994187
Message ID:
00997698
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Is there any Word cell property (or related object model PEM) that tells me wheher a particular cell is merged? I scanned through the cell object's PEM and didn't see anything obvious.
>
>What I'm doing is trying to omit examining the next row's cell if its bound to produce a COM error by asking. Currently I'm using TRY/CATCH to procedurally bypass the condition, but seems slow and inelegant.

While not precisely answering the merged question, a technique for error avoidance is to iterate the Cells collection of the table's range, rather than iterating the table's rows. When you iterate the cells, you can get the coordinates of each cell, and infer any "hole" must have been caused by some spanning/merging. This is shown by the following VFP code, which populates a 2-D array with those cell objects that exist.
lnRows = loWordTable.Rows.Count
lnCols = loWordTable.Columns.Count
lnCells = loWordTable.Range.Cells.Count
DIMENSION laTbl[m.lnRows, m.lnCols]
laTbl = NULL  && default all to NULL, and remaining NULLs represents merged cells
FOR lnCell = 1 TO m.lnCells
  loCell = loWordTable.Range.Cells(m.lnCell)
  lnRow = loCell.ColumnIndex 
  lnColumn = loCell.RowIndex
  laTbl[m.lnRow, m.lnColumn] = m.loCell && alt: loCell.Range.Text
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform