How to set up code to insert two paragraphs when a database field shows yes

L

LabrGuy Bob R

Hello, I have Excel 2003, WORD 2003 with Windows XP Professional.

My problem is I have a mail merge document that uses an Excel database for
the WORD merge document. I have eight paragraphs that are numbered with
Roman Numerials in an outline form:
I.
II.
III. etc all the way to VIII.
I have a data field in a workbook named "FullDatabase" and I'm taking the
merge trigger from the "COJ Database" sheet and the "YESUBP" data field.
If YESUBP = NO then I would like to have nothing show up between the two
paragraphs listed below.


I. All documents or records relating to persons under the age of
18 who were employed by «corp_name», from and including the period from
«SubpoenaBeginPeriodDate» through «SubpoenaEndPeriodDate»; ***Paragraph
spacing stays this way for NO.****

It may be necessary for the North Carolina Department of Labor to remove and
retain the above-listed documents fro the purpose of copying, before the
documents are returned to you. .........................................


and if it is a YES I would like to have the below two paragraphs displayed
with automatic numbering of the Roman Numerials, if possible and if not then
the IX. All....... and then X. All.......but the code would make it so
the formatting would appear like this appears.

VIII. All documents or records relating to persons under the age of 18
who were employed by «corp_name», from and including the period from
«SubpoenaBeginPeriodDate» through «SubpoenaEndPeriodDate»;

IX. All documents or records showing the amount of tips received by
all persons for the period from and including January 01, 2006 through
September 15, 2007;

X. All documents and records showing the amount of service charges
and/or mandatory gratuities received by all persons who were employed by
Granny's Kitchen, for the period from and including January 01, 2006 through
September 15, 2007.

It may be necessary for the North Carolina Department of Labor to remove and
retain the above-listed documents fro the purpose of copying, before the
documents are returned to you.



I hope someone can help me with the code and thanks in advance.... PS I'm
not experienced with code so if there is a solution could it be listed in
the form of a macro with the paths listed above.



THanks

BOB R
 
P

Peter Jamieson

Doing auto-numbered paragraphs in Word mailmerge is, as you have discovered,
a pain.

One possibility is to use { SEQ } fields to do the numbering. However, {
SEQ } fields do not behave well inside IF fields.

As long as the number of possible combinations is small it may be simpler to
a. identify the "paragraph schemes" you need e.g. one with paras 1,2,3,4,
one with paras 1,2,3,4,7,8 or whatever
b. do not use autonumbering
c. put the complete text for each "paragraph scheme" in a different branch
of an IF field's results.

Nasty duplicaiton but it's much more likely to work properly.
 

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