Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Know You Have Vertical Cells Merged
Message
De
20/03/2005 14:46:15
 
 
À
09/03/2005 17:10:02
Information générale
Forum:
Microsoft Office
Catégorie:
Word
Divers
Thread ID:
00994187
Message ID:
00997698
Vues:
16
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform