Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 42
Default Problem joining tables

I have two tables separated by text. I want to join the tables by
deleting the text. This is a technique I have used before with
INCLUDETEXT to form a single table. A narrow blank strip remains between
the two tables.

e.g.
I have
t1r1
t1r2
....
t1rn
text between
t2r1
t2r2
....

When I delete "text between", I get a small horizontal strip between the
two tables.

If I add rows so I have
....
t1rn
t1rn+1
text between
t2r0
t2r1
....

and select t1rn+1 to t2r0 inclusive, I can achieve the desired result by
deletion.

However, I find automating that hard. ;(

The desired result is

....
t1rn
t1rn+1
tern+2
....
--
Walter Briscoe
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem joining tables

Where does the INCLUDETEXT come into the picture?

--
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

"Walter Briscoe" wrote in message
...
I have two tables separated by text. I want to join the tables by deleting
the text. This is a technique I have used before with INCLUDETEXT to form a
single table. A narrow blank strip remains between the two tables.

e.g.
I have
t1r1
t1r2
...
t1rn
text between
t2r1
t2r2
...

When I delete "text between", I get a small horizontal strip between the
two tables.

If I add rows so I have
...
t1rn
t1rn+1
text between
t2r0
t2r1
...

and select t1rn+1 to t2r0 inclusive, I can achieve the desired result by
deletion.

However, I find automating that hard. ;(

The desired result is

...
t1rn
t1rn+1
tern+2
...
--
Walter Briscoe



  #3   Report Post  
Posted to microsoft.public.word.tables
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 42
Default Problem joining tables

In message of Wed, 22 Oct 2008
08:34:13 in microsoft.public.word.tables, Doug Robbins - Word MVP
writes
Where does the INCLUDETEXT come into the picture?


I must apologise, In my original posting, I forgot to say I am using
Word 2003 (11.5604.5606).

I have a main document which consists of tables separated by INCLUDETEXT
directives.

File foo.doc contains:
t1r1
t1r2
aaa{INCLUDETEXT bar.doc bookmark}aaa
t3r6
t3r7
....

"bookmark" in bar.doc consists of
t2r3
t2r3
t2r5


After the INCLUDETEXT is resolved in a mailmerge operation, I get a
document containing
t1r1
t1r2
aaa
t2r3
t2r4
t2r5
aaa
t3r6
t3r7
....

I have a macro which zaps the "aaa" lines. I want to end up with a
single 7 row table:
t1r1
t1r2
t1r3
t1r4
t1r5
t1r6
t1r7

I actually end up with 3 tables separated by by very thin blank rows:
t1r1
t1r2
t2r3
t2r4
t2r5
t3r6
t3r7

The zapping code is
' Delete aaa lines
Selection.Find.ClearFormatting
With Selection.Find
.Text = "aaa"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Loop

(That code is probably over-specified, but worked as I want in a
previous project.)
--
Walter Briscoe
  #4   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem joining tables

Try using:

Dim arange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="FD", MatchWildcards:=False,
MatchCase:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Set arange = Selection.Paragraphs(1).Range
arange.Delete
Loop
End With


--
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

"Walter Briscoe" wrote in message
...
In message of Wed, 22 Oct 2008
08:34:13 in microsoft.public.word.tables, Doug Robbins - Word MVP
writes
Where does the INCLUDETEXT come into the picture?


I must apologise, In my original posting, I forgot to say I am using
Word 2003 (11.5604.5606).

I have a main document which consists of tables separated by INCLUDETEXT
directives.

File foo.doc contains:
t1r1
t1r2
aaa{INCLUDETEXT bar.doc bookmark}aaa
t3r6
t3r7
...

"bookmark" in bar.doc consists of
t2r3
t2r3
t2r5


After the INCLUDETEXT is resolved in a mailmerge operation, I get a
document containing
t1r1
t1r2
aaa
t2r3
t2r4
t2r5
aaa
t3r6
t3r7
...

I have a macro which zaps the "aaa" lines. I want to end up with a
single 7 row table:
t1r1
t1r2
t1r3
t1r4
t1r5
t1r6
t1r7

I actually end up with 3 tables separated by by very thin blank rows:
t1r1
t1r2
t2r3
t2r4
t2r5
t3r6
t3r7

The zapping code is
' Delete aaa lines
Selection.Find.ClearFormatting
With Selection.Find
.Text = "aaa"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Loop

(That code is probably over-specified, but worked as I want in a
previous project.)
--
Walter Briscoe



  #5   Report Post  
Posted to microsoft.public.word.tables
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 42
Default Problem joining tables

In message of Fri, 24 Oct 2008
05:34:55 in microsoft.public.word.tables, Doug Robbins - Word MVP
writes
Try using:

Dim arange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="FD", MatchWildcards:=False,
MatchCase:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Set arange = Selection.Paragraphs(1).Range
arange.Delete
Loop
End With


That is wonderful! Much more elegant than my efforts.

I still do not understand what is going on. In some circumstances
deleting the paragraph from
table1
paragraph
table2

results in
table3
where table1 has table2 welded to it to form table3.
In others it results in
table1
table2
where table1 is followed by table2 without any weld.

What are the criteria for Word welding the two tables?

(I test that rows are in the same table by doing table
properties/row/next row in the last row of table1.
If the two tables weld, next row crosses to the first row of table2; if
they merely follow, next row goes to the first row of table1.)

I can probably live with separate adjacent tables rather than welded
tables. However, I am frustrated at my lack of understanding.
--
Walter Briscoe


  #6   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem joining tables

Check the Text Wrapping of the tables under the TablesProperties dialog

--
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

"Walter Briscoe" wrote in message
...
In message of Fri, 24 Oct 2008
05:34:55 in microsoft.public.word.tables, Doug Robbins - Word MVP
writes
Try using:

Dim arange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="FD", MatchWildcards:=False,
MatchCase:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Set arange = Selection.Paragraphs(1).Range
arange.Delete
Loop
End With


That is wonderful! Much more elegant than my efforts.

I still do not understand what is going on. In some circumstances deleting
the paragraph from
table1
paragraph
table2

results in
table3
where table1 has table2 welded to it to form table3.
In others it results in
table1
table2
where table1 is followed by table2 without any weld.

What are the criteria for Word welding the two tables?

(I test that rows are in the same table by doing table properties/row/next
row in the last row of table1.
If the two tables weld, next row crosses to the first row of table2; if
they merely follow, next row goes to the first row of table1.)

I can probably live with separate adjacent tables rather than welded
tables. However, I am frustrated at my lack of understanding.
--
Walter Briscoe



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joining Tables Idaho Word Man Microsoft Word Help 6 July 9th 08 11:15 PM
joining tables Janette Tables 1 September 17th 07 08:10 PM
Joining tables Jackie Smith Microsoft Word Help 5 December 16th 05 04:36 PM
Splitting and joining tables Dave Neve Microsoft Word Help 7 August 26th 05 12:25 AM
Joining two tables in the same section John Barnes Tables 6 March 9th 05 09:14 AM


All times are GMT +1. The time now is 01:01 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"