View Single Post
  #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