Making 2 Tables into 1 Table

  • Thread starter NZ VBA Developer
  • Start date
N

NZ VBA Developer

More stuff on tables... Will MS _ever_ get it right?

I've got 2 tables with a blank line in between them. (They were created
independly of each other, not by simply splitting one table into two.)
Normally, if you remove the blank line between 2 tables the tables become 1
automatically. However, sometimes (like this time) the tables stay as 2
tables, even though there's nothing between them - not even a continuous
section break. I really don't want to have to go through all the work of
recreating a single table as the 2 tables are both quite complex - lots of
varying column widths within groups of rows and styles and shading and
borders, etc.

Does anyone know of a way - either manually or through code - to force these
two tables to concatenate?
 
D

Doug Robbins - Word MVP

Add a new row at the end of the first table, then select the second table
and use Right Click Cut and then select the new row that you added to the
first table and the Right Click and use Paste Rows. Then delete the empty
row

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
N

NZ VBA Developer

A noble effort, Doug, but alas no joy. Now I have 3 separate tables: the
original 2 and a third with just a blank row in it below the second one. It's
not terribly important (yet) that it all be just one table, so I think I'll
just leave it for now. If it becomes critical I guess I'll have to rebuild
the table from scratch. :-(
--
Cheers!
The Kiwi Koder


Doug Robbins - Word MVP said:
Add a new row at the end of the first table, then select the second table
and use Right Click Cut and then select the new row that you added to the
first table and the Right Click and use Paste Rows. Then delete the empty
row

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

I'd be interested in seeing the document if you can share it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

NZ VBA Developer said:
A noble effort, Doug, but alas no joy. Now I have 3 separate tables: the
original 2 and a third with just a blank row in it below the second one.
It's
not terribly important (yet) that it all be just one table, so I think
I'll
just leave it for now. If it becomes critical I guess I'll have to rebuild
the table from scratch. :-(
 
N

NZ VBA Developer

I'll send you a 'sanitised' version - just the segment of the doc that
contains the 'Troublesome Tables'. It's part of a much larger template, but
I've confirmed that the problem still exists even when the tables in question
are removed from their natural environment.
 
D

Doug Robbins - Word MVP

The issue here was that one of the tables had the "Text wrapping" set to
"Around" and for the other, it was set to "None".

The setting must be the same to enable tables to be joined into one.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
N

NZ VBA Developer

That's got it! Thanks, Doug. The hazards of working with someone else's
templates...
 
J

Julian

Nice detective work Doug... any chance of a magnifying glass?

In particular - is there any (VBA) method for interating over an object's
properties without knowing what they are (but with some way to find out what
they are!) so that one could compare two objects (of the same class!) like
this to find such miscreants?

For i = 1 to objA.properties.count
If objA.properties(i) <> objB.properties(i) then
debug.print "Property " & objA.properties(i).name & " are
differerent" '... debug values etc.
Endif
Next

I can think of lots of uses for being to iterate over properties but have
never found a way to do it...
 
T

tooolnut

I'm having a similar problem joining tables that used to be one and the same
until I moved rows to rearrange them in the same table by selecting and
dragging. This was never a problem with Word 2003. The tables have the same
properties and yet they won't be joined no matter what I try, including your
suggestions here.

If there are slight differences in table properties which prevent them from
being joined, how does on copy and paste formatting only from one table to
another, without having to compare each property one at a time?
 
S

Stefan Blom

What goes wrong? If both tables have "Text wrapping" set to "None" it should
be a straightforward task to delete the paragraph mark(s) between tables to
merge them. To see what you are doing, you may want to display nonprinting
marks (Ctrl+Shift+8 toggles their display).

Note that if you are saying that column widths do not match, you can fix
that by holding the Alt key while dragging the border (or gridline, if no
borders are displayed) in place.

--
Stefan Blom
Microsoft Word MVP


in message
 
T

tooolnut

Thanks for your prompt assistance, Stefan.

There is no paragraph mark: the tables appear to be welded together, except
that the horizontal gridline separating them is heavier. The column widths
are identical, as far as I can tell, but this shouldn't be the reason they
cannot be joined, as it should be possible to have cells and columns of
differing sizes in the same table; at least that's how it's always been
before WORD 2007.
 
S

Stefan Blom

Switch to Draft view. Is there a continuous section break between the
tables? If so, delete it.

--
Stefan Blom
Microsoft Word MVP


in message
 
T

tooolnut

There is absolutely nothing between the two, nothing that I can delete. There
is just the normal mark at the end of a table row (which I can select with
Shift and arrow key) but "deleting" that does not actually delete it and has
no effect.
 
T

tooolnut

It appears that the problem lies with the conversion of the 2003 files by the
2007 software. All the tables created with Word 2003 display the same
symptoms when I move their rows around: the moved rows become a new and
separate table, splitting the old table into two pieces at the insertion
point. If I continue to move all but the last of the rows from the old table
to the new table, the new table does not get split up at all; the splitting
occurs only if I move from the old table to a different spot in the old
table, or to one of the split-up pieces of the old table.

A lone row not yet moved from the old table needs a different treatment,
because if moved, the entire row would insert itself into the first cell in
the row you're attempting to insert above. To prevent this from happening,
you need to add a dummy row to the lone remaining row in the old table, then
move this row by itself to the new table, and finally delete the dummy row.
The new table thus created will henceforth work as it used to (as far as the
moving of rows is concerned) in Word 2003, even if saved in that format, then
reopened.

Seems like a nuisance bug to work around: I hope you can provide a fix for
it in your updates.

Thanks.
 
T

tooolnut

Another interesting, and easier, way to solve the problem, that I just
found, is to open the 2003 ".doc" file, and save it as a "Word Document",
i.e. in the new ".docx" format. The moving of rows works as it should after
that, even when you resave it as a "Word 97-2003 Document". Also,
mysteriously, the size of the ".docx" document is one fourth to one seventh
that of the old ".doc" document (the larger the original file, the greater
the ratio; my largest original file size was around 220KB), whereas the new
".doc" document is only slightly smaller than the old.

I am surprised at the astounding shrinking of the files! I wonder what kind
of information is stripped in the process.

--tooolnut
 
S

Stefan Blom

If possible, I'd like to take a look at the problem file. You can send it to
(e-mail address removed).
 
S

Stefan Blom

tooolnut said:
Another interesting, and easier, way to solve the problem, that I just
found, is to open the 2003 ".doc" file, and save it as a "Word Document",
i.e. in the new ".docx" format. The moving of rows works as it should
after
that, even when you resave it as a "Word 97-2003 Document".

This would indicate document corruption, which I could confirm when I
received the file by email. For information on document and template
corruption in general, see
http://word.mvps.org/FAQs/AppErrors/CorruptDoc.htm.
Also,
mysteriously, the size of the ".docx" document is one fourth to one
seventh
that of the old ".doc" document (the larger the original file, the greater
the ratio; my largest original file size was around 220KB), whereas the
new
".doc" document is only slightly smaller than the old.

I am surprised at the astounding shrinking of the files! I wonder what
kind
of information is stripped in the process.

The new file format simply creates smaller files.

--
Stefan Blom
Microsoft Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top