
Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
On 1/14/05 6:08 PM, in article OJQNeZp#EHA.1524@TK2MSFTNGP09.phx.gbl, "Doug
Robbins" <dkr@NOmvpsSPAM.org> wrote:
> Why not just convert the table to text and then use a wildcard search and
> replace to replace consecutive tabs with a single tab?
Because, as I said, some instances of consecutive tabs need to be preserved
and some don't. That's why the intelligence to put a placeholder string in
_certain_ empty cells is desirable.
Bill Planey
Jezebel - 15 Jan 2005 04:27 GMT
Word tables get seriously tricky if you have merged or split cells. Without
knowing the logic of when you want to preserve the cells and when you don't
it's hard to offer specific suggestions. Are you familiar with the RowIndex
and ColumnIndex properties? You can use these to recognise if a cell is
merged or split, and they are always available -- unlike the Row and Column
properties.
To get a feel for what's going on, create a table with some merged and split
cells of the sort of complexity your code has to deal with. Put some
recognizable text into each cell, then run the following --
Dim pCell As Word.Cell
Set pCell = ActiveDocument.Tables(1).Cell(1, 1)
Do
Debug.Print Left$(pCell.Range, Len(pCell.Range) - 2), _
pCell.RowIndex, pCell.ColumnIndex
Set pCell = pCell.Next
Loop Until pCell Is Nothing
You've probably worked it out already: a cell is empty if the length of its
range = 2 -- a cell always contains vbCr Chr(7)
> On 1/14/05 6:08 PM, in article OJQNeZp#EHA.1524@TK2MSFTNGP09.phx.gbl, "Doug
> Robbins" <dkr@NOmvpsSPAM.org> wrote:
[quoted text clipped - 7 lines]
>
> Bill Planey
Bill Planey - 15 Jan 2005 15:09 GMT
Thanks, I'll try that.
Bill
On 1/14/05 10:27 PM, in article #A1B6pr#EHA.4028@TK2MSFTNGP15.phx.gbl,
> Word tables get seriously tricky if you have merged or split cells. Without
> knowing the logic of when you want to preserve the cells and when you don't
[quoted text clipped - 34 lines]
>>
>> Bill Planey