Merge fields in header

E

Ed

I have a form that has a header and four "subforms". The header has
MailMerge fields for the <<SUBMITTER>> and his <<PHONE>. Each subform
has several data fields. I have <<Next RECORD>> in front of the first
field in the second, third and forth
subforms. All of the data is in an Excel worksheet. In addition to the
data needed for the subforms, each row repeats the
SUBMITTER and PHONE, although these items are the same for all rows.

The scheme works pretty well. If there are more than four rows in the
Excel worksheet a new form is started. But, here's the glitch.
The SUBMITTER and PHONE fields are left blank in all forms but the
first. So, how do I get it to fill these fields in the second and
later forms?

TIA

Ed
 
D

Doug Robbins - Word MVP

By "header", do you mean header as in the header and footer of the document?

How are the subforms separated from each other and from the "header" If
they are in separate Sections and the "header" is of the type mentioned
above, do you have a header set up in each of those sections?

If the "header" is of the type mentioned above, you could probably achieve
what you want by linking the headers in the following sections (sub forms)
to the header in the "header"

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

Peter Jamieson

Try this:

a. Put the { MERGEFIELD submitter } somewhere in your form (e.g. just after
the LASTNAME mergefield in the first block in the form.
b. Modify the field so it reads
{ MERGEFIELD submitter \*Charformat }
c. create a character style called (say) submitterstyle
d. set the font of submitterstyle to have colour white
e. apply the style to the mergefield you just entered (apply it to the
mergefield code, not the result)
f. replace the { MERGEFIELD submitter } field that you have in your header
by

{ STYLEREF submitterstyle }
 
E

Ed

Thanks, Peter.

I gave it a try but it doesn't work. Perhaps I don't understand
exactly how to do Step f. I tried it with both
<<STYLEREF SubmitterStyle>> and {STYLEREF SubmitterStyle} but it
doesn't work. In fact,
now the submitter name from the data source doesn't appear on even the
first page.

What am I missing?

Ed
 
D

Doug Robbins - Word MVP

Did you use Ctrl+F9 to insert the field delimiters { } for {STYLEREF
SubmitterStyle} ?

The submitter name will not appear on the first page because if you followed
Peter's instructions correctly, the font in the SubmitterStyle is formatted
as white.

One thing that you might have to do however is add a \* charformat switch to
the
{STYLEREF SubmitterStyle} field and format the S of STYLEREF so that the
colour of the font is black.

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

Ed

Doug, Peter,

Well I wasn't using CTRL-F9, but I am now without success. I guess i
don't understand the
difference between the << >> that is produced when a MailMerge field
is inserted and
the CTRL-F9 { }.

Ed
 
P

Peter Jamieson

Well I wasn't using CTRL-F9, but I am now without success. I guess i don't
understand the
difference between the << >> that is produced when a MailMerge field is
inserted and
the CTRL-F9 { }.

With most field types, Word can either display
a. the field code (e.g. { REF xyz }
b. the field result - if the bookmark xyz is set to "23.2", the result of
{ REF xyz } is 23.2

You can toggle between "codes" and "results"

With Merge fields, "results" can be displayed in two different ways,
depending on whether you are previewing the data or not. So you might see
a. a field code such as { MERGEFIELD myfield }
b. a field "result" when you are not previewing, which would look like
<<myfield>>
c. a field result when you are previewing, which would show the data from
the currently selected record in the data source, e.g. 23.2

It may be that that knowledge will help you identify that you are doing
something differently from the approach Doug and I suggested, or it may be
that you have done everything correctly and it simply does not not work for
you there. If you despam my address (remove "KillmapS") and email your doc
as you have it now, plus some sample data, I will try it here (please remind
me which version of Word you are using.
 
P

Peter Jamieson

I emailed a revised version of your sample back - if you didn't get it, drop
me another email and I'll try again - or you can see if the following
instructions work:

The main points are:
a. make sure you can see the underlying field codes (in the view where they
look like { MERGEFIELD myfield }
b. Apply the Submitterstyle style to the entire { MERGEFIELD Submitter
\*Charformat } field (including the field code braces
c. The { STYLEREF SubmitterStyle } field in the header has ordinary braces
instead of the special field code braces. You need to delete the ordinary
ones, select "STYLEREF SubmitterStyle" and press ctrl-F9 to insert some real
field code braces.
d. Seems to work here in Word 2003.
 
E

Ed

Peter,

Yes, I got it and it works! Thanks.

I now notice I have to do the same thing with the PHONE field.

Ed
 

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