View Single Post
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Printing merged data into 2 columns

There will always be one ¶ after the table, but if there is only one of
them, when you execute the merge, everything will be in one single table.
Are you saying that each record is in a table of its own with a blank line
between them?

If you want additional text in the document, you must add that after
executing the merge.

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

"magicdds" wrote in message
...
I am looking at the paragraph marks. While there are none inside the table,
there is one on the left side of the page, just below the table. This is
what
is causing the extra blank line between each row of the table because if I
type something on that line, it prints between each row of data in the
table.
The problem is, I can't seen to get that paragraph mark to delete. Any
suggestion on how to delete it.

This also presents a new problem. When I type a concluding paragraph to my
letter, under the table, instead of that paragraph printing once, under
the
table, it prints after each row of the table. How do I get it to only
print
once at the end of the table?



"Doug Robbins - Word MVP" wrote:

You must either have some carriage returns in the cells, or it is the
spacing between your paragraphs.

With the mailmerge main document open, press the ¶ button to show the
paragraph marks. There should be none inside the table.

One thing I have noticed that the first time that you run the merge, it
says
that there is an error in record 1, I think it is and the name of the
citry
is inserted twice. When you run it again however, the error or
duplication
of the city name does not occur.

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

"magicdds" wrote in message
...
Thanks for the help so far. I almost have what I need.

The problem is that when I merge the data to the word document, while
the
data prints properly in each cell, the height of the cell is too tall.
It
seems that the cell adds extra carriage returns to the merged document,
due
to the length of the conditional statements that are in the cell. How
can
I
get the document to print with no empty lines between each row of the
the
table?




"Doug Robbins - Word MVP" wrote:

In your catalog (or directory) mail merge main insert a three column
one
row
table and in the first row, set up the following field construction:

{ IF { MERGESEQ } = "1" "{ MERGEFIELD City }{ SET Place2 { MERGEFIELD
City} }" "{ SET Place1 { MERGEFIELD City }}" }{ IF { Place2 } {
Place1 }
"{ MERGEFIELD City }" "" }

In the second column, insert

{ MERGEFIELD Employee }

and in the third column, insert

{ MERGEFIELD Amount }{SET Place2 { MERGEFIELD City} }
--
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

"magicdds" wrote in message
...
This is similar to the code that I used to merge my Access Data into
the
Word
Letter:

{ IF { MERGESEQ } = "1" "{ MERGEFIELD City }" "" }ENTER
{ SET Place1 { MERGEFIELD City }}ENTER
{ If { Place2 } { Place1 }"ENTER
{ MERGEFIELD City }ENTER
ENTER
{ MERGEFIELD Employee }{ MERGEFIELD Sales }" "{ MERGEFIELD
Employee }{
MERGEFIELD Sales }" }{ SET Place2 { MERGEFIELD City }}ENTER


I just need to get { MERGEFIELD Employee }{ MERGEFIELD Sales } to
tab
over
to a certain column. Isn't there an easier way than to write all the
code
below (especially since I'm not familiar with most of it)?



"Doug Robbins - Word MVP" wrote:

If you create a Catalog (or in Word XP and later, it's called
Directory)
type mailmerge main document with the mergefields in the cells of a
one
row
table in the mailmerge main document with the keyfield (City) in
the
first
cell in the row and then execute that merge to a new document and
then
run
the following macro with that new document as the active document,
it
will
create a new document with the data arranged in the way that you
want.

Dim source As Document, target As Document, scat As Range, tcat As
Range
Dim data As Range, stab As Table, ttab As Table
Dim i As Long, j As Long, k As Long, n As Long
Set source = ActiveDocument
Set target = Documents.Add
Set stab = source.Tables(1)
k = stab.Columns.Count
Set ttab = target.Tables.Add(Range:=Selection.Range, numrows:=1,
numcolumns:=k)
Set scat = stab.Cell(1, 1).Range
scat.End = scat.End - 1
ttab.Cell(1, 1).Range = scat
For n = 2 To k
Set data = stab.Cell(1, n).Range
data.End = data.End - 1
ttab.Cell(1, n).Range = data
Next n
j = ttab.Rows.Count
For i = 2 To stab.Rows.Count
Set tcat = ttab.Cell(j, 1).Range
tcat.End = tcat.End - 1
Set scat = stab.Cell(i, 1).Range
scat.End = scat.End - 1
If scat tcat Then
ttab.Rows.Add
j = ttab.Rows.Count
ttab.Cell(j, 1).Range = scat
ttab.Cell(j, 1).Range.Paragraphs(1).PageBreakBefore = False
ttab.Cell(j + 1, 1).Range.Paragraphs(1).PageBreakBefore =
False
For n = 2 To k
Set data = stab.Cell(i, n).Range
data.End = data.End - 1
ttab.Cell(ttab.Rows.Count, n).Range = data
Next n
Else
ttab.Rows.Add
For n = 2 To k
Set data = stab.Cell(i, n).Range
data.End = data.End - 1
ttab.Cell(ttab.Rows.Count, n).Range = data
Next n
End If
Next i

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

"magicdds" wrote in message
...
I Used mail merge to create a list sorted by category as per
Article
ID
211303. It works just as described. The article has the "City"
printed
followed by the "Employees" and "sales" listed in a single
column. I
want
my
results to look as follows:

Atlanta: Smith $3000
Gates $50,000
Henderson $10,000

Houston: Jones $8,000
Kelly $9,000
Peterson $0

How can I program in that after "City" is printed, the cursor
needs
to
tab
over to the right column, prior to printing each of the
"Employees"
.
Also,
if the "Employees" data is so long that it continues over to the
next
line,
it needs to first tab over to the right side column before
continuing
to
print.

Thanks for any help you can give.
Mark