Reply
 
Thread Tools Display Modes
  #1   Report Post  
Joseph N.
 
Posts: n/a
Default Merge Fields, Headers, Etc.

[Thought I had posted this recently, but have seen no replies. Seems like an appropriate post, so I'm trying again. Sorry if this breaches etiquette.]

I am trying to create a directory merge and have some questions:

1. Is there any way to have merge fields a header? I am merging from a db which is managing the export/merge operation and handing the desired fields to Word (Word 2002). I have put the fields in a header, but only the field names, not the variable database data, result in the finished document.

2. I am placing the information in a table. It looks like the only way I can predictably format the borders of the table is to select "all," i.e., lines between and around all of the cells. Does other formatting--like only above and below each row/record--have to wait until after the merge operation is completed?

3. Why does LISTNUM work but not SEQ? SEQ does not advance; all rows are numbered "1."

TIA.

--
JN

jbn 'won'oh'won'six'won' at fastmail.fm
Remove spaces, and substitute digits for the words between " ' "
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

Re 1, are you saying that you want the Directory to appear in the Header of
the document? I haven't tried it and I guess from what you say, you have,
and it doesn't work. I think that there is your answer.

Re 2, the borders that I set up in the table in the mailmerge main document
(above and below only) are faithfully replicated in the document produced by
executing the merge. I assume that you are not mixing up the borders with
the gridlines that can be turned off from the Tables menu.

Re 3, {SEQ} fields are destroyed by the mailmerge process. If you do an
Alt+F9 in the document produced by the merge, you will see that there are no
{SEQ} fields there.

--
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
"Joseph N." wrote in message
...
[Thought I had posted this recently, but have seen no replies. Seems like
an appropriate post, so I'm trying again. Sorry if this breaches
etiquette.]

I am trying to create a directory merge and have some questions:

1. Is there any way to have merge fields a header? I am merging from a
db which is managing the export/merge operation and handing the desired
fields to Word (Word 2002). I have put the fields in a header, but only
the field names, not the variable database data, result in the finished
document.

2. I am placing the information in a table. It looks like the only way I
can predictably format the borders of the table is to select "all," i.e.,
lines between and around all of the cells. Does other formatting--like
only above and below each row/record--have to wait until after the merge
operation is completed?

3. Why does LISTNUM work but not SEQ? SEQ does not advance; all rows are
numbered "1."

TIA.

--
JN

jbn 'won'oh'won'six'won' at fastmail.fm
Remove spaces, and substitute digits for the words between " ' "



  #3   Report Post  
Joseph N.
 
Posts: n/a
Default

On Fri, 10 Dec 2004 11:06:20 GMT, Doug Robbins wrote:

Re 1, are you saying that you want the Directory to appear in
the Header of the document?


No. The directory appears correctly in a table in the main part of the document. What I'm trying to get into the first page header are some identifying information (client, matter, etc.) from the database. But it's just not going in. (Suzanne Barnhill suggested that not all merge fields operate in headers and footers, but she suggested that I ask in this newsgroup.)

Re 2, the borders that I set up in the table in the mailmerge
main document (above and below only) are faithfully replicated
in the document produced by executing the merge. I assume that
you are not mixing up the borders with the gridlines that can be
turned off from the Tables menu.


Correct; I am not. Did you have more than one row set up?

--
JN

jbn 'won'oh'won'six'won' at fastmail.fm
Remove spaces, and substitute digits for the words between " ' "
  #4   Report Post  
Doug Robbins
 
Posts: n/a
Default

Hi Joe,

See response in line.

--
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
"Joseph N." wrote in message
...
On Fri, 10 Dec 2004 11:06:20 GMT, Doug Robbins wrote:

Re 1, are you saying that you want the Directory to appear in
the Header of the document?


No. The directory appears correctly in a table in the main part of the
document. What I'm trying to get into the first page header are some
identifying information (client, matter, etc.) from the database. But
it's just not going in. (Suzanne Barnhill suggested that not all merge
fields operate in headers and footers, but she suggested that I ask in
this newsgroup.)


No, as you have discovered, that will not work with a directory type
mailmerge document. If you set the document up as a letter type mailmerge
or a label type, which means that you will have to insert multiple sets of
rows populated with merge fields in the one page main document, with a
Next Record field before the first mergefield in each set, except the
first, the header can then be made to display the information for the fields
that are in the header that comes from the last record on each page -
probably not what you want.

I suspect from this that what you are trying to do is to create some sort of
"one to many" report in which the information in the header is the "one" and
that in the body of the document is the "many". If the data originates from
Access, I would recommend that you use an Access Report as it can handle
that sort of thing better than Word. See the information at the foot of
this message for some more comments on that.

Re 2, the borders that I set up in the table in the mailmerge
main document (above and below only) are faithfully replicated
in the document produced by executing the merge. I assume that
you are not mixing up the borders with the gridlines that can be
turned off from the Tables menu.


Correct; I am not. Did you have more than one row set up?


OK, with two rows and with a border at the top of the top row and one at the
bottom of the second row, achieved by deleting the border between the rows
via FormatBorders and Shading, when the merge is executed, there is only
the border at the top of the table. However, if I use the table drawing
tool on the Tables and Borders toolbar to "draw-in" the border at the bottom
of the second row, when the merge is executed, that border is retained -
i.e. I can get a border between the data for each record.


Word does not really have the ability to perform a "multiple items per
condition (=key field)" mailmerge.

See the "Multiple items per condition" item under the "Special merges"
section of fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm

Or, if you create a Catalog (on 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 in the first cell in
the row and then execute that merge to a new document and then run the
following macro, it will create separate tables with the records for each
key field in them. With a bit of further development, you may be able to
get it to do what you want.

' Macro to create multiple items per condition in separate tables from a
directory type mailmerge

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 - 1)
Set scat = stab.Cell(1, 1).Range
scat.End = scat.End - 1
ttab.Cell(1, 1).Range = scat
j = ttab.Rows.Count
For i = 1 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 = True
ttab.Rows.Add
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 - 1).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 - 1).Range = data
Next n
End If
Next i


--
JN


Remove spaces, and substitute digits for the words between " ' "



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
Empty Mail Merge Fields Meggan Microsoft Word Help 1 January 13th 05 06:22 AM
Empty Mail Merge Fields Meggan Microsoft Word Help 0 January 13th 05 01:43 AM
Merge fields in word tables populate by a VBA query Saeed Tables 3 January 12th 05 10:36 PM
Merge Fields in Header? Joseph N. Mailmerge 4 December 14th 04 11:23 AM
Using MAILMERGE fields within HYPERLINK fields for Merge to Email Mark V Mailmerge 2 December 4th 04 05:01 PM


All times are GMT +1. The time now is 06:41 AM.

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"