A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problems numbering a mailmerge doc with condtional paragraphs



 
 
Thread Tools Display Modes
  #1  
Old August 13th, 2009, 10:30 PM posted to microsoft.public.word.mailmerge.fields
JollyMike
external usenet poster
 
Posts: 1
Default Problems numbering a mailmerge doc with condtional paragraphs

I am having more than a headache while attempting to autonumber my paragraphs
in a Mergedoc. My document contains conditional paragraphs that are within
IF statements. e.g. 24) blah blah blah {IF {MERGEFIELD asdf} = "True" " 25)
blah blah blah" "" 26) blah blah blah. What I need to do is automatically
renumber paragraphs based on the conditional paragraphs. My document is 26
pages (not including mergecode) and contains 50+ numbered paragraphs
(sections) many of which are conditional. This makes renumbering the entire
document every time I have a conditional paragraph undesirable. I have tried
the {SEQ} method of numbering (which doesn't like IF statements) as well as
normal autonumbering. Nothing has worked for me. Please help, I am running
out of aspirin.

Thx

My Document is laid out as such:

1) unconditional
2) unconditional
3) conditional
4) unconditional
5) conditional
6) conditional
7) unconditional...and so on
  #2  
Old August 14th, 2009, 06:57 AM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Problems numbering a mailmerge doc with condtional paragraphs

Hi Jollymike,

I see you've posted the same question in multiple forums. Please see: http://www.excelguru.ca/node/7

As for the solution, you could use a series of fields coded along the lines of:
{SET Para 0}¶
{QUOTE "{SET Para {=Para+1}}{=Para}"}¶
and
{IF{MERGEFIELD MyOption1}= "Print" "{SET Para {=Para+1}}{REF Para} Optional Text¶
"}
The first field re-sets a 'Para' numbering bookmark to 0 for each mailmerge record.
The second field updates the 'Para' numbering bookmark and displays the paragraph number for paragraphs of required text. You add
the required text before the paragraph mark.
The third field optionally increments the paragraph count and inserts the optional text, if the relevant mergefield (in this
example, named MyOption1) contains the string 'Print'. Change both the field name and the condition to suit your requirements. Note
that, for the optional text, the final paragraph mark is within the field code. That's because the paragraph mark is suppressed if
there's no text to display. The fields for the optional fields are thus appended to the following paragraph. This means you could
have multiple optional fields all pre-pending a required paragraph. For example:
{QUOTE "{SET Para {=Para+1}}{=Para}"} Required Text¶
{IF{MERGEFIELD MyOption1}= "Print" "{SET Para {=Para+1}}{REF Para} Optional Text¶
"}{IF{MERGEFIELD MyOption2}= "Print" "{SET Para {=Para+1}}{REF Para} Optional Text¶
"}{IF{MERGEFIELD MyOption3}= "Print" "{SET Para {=Para+1}}{REF Para} Optional Text¶
"}{QUOTE "{SET Para {=Para+1}}{=Para}"} Required Text¶

--
Cheers
macropod
[Microsoft MVP - Word]


"JollyMike" wrote in message ...
I am having more than a headache while attempting to autonumber my paragraphs
in a Mergedoc. My document contains conditional paragraphs that are within
IF statements. e.g. 24) blah blah blah {IF {MERGEFIELD asdf} = "True" " 25)
blah blah blah" "" 26) blah blah blah. What I need to do is automatically
renumber paragraphs based on the conditional paragraphs. My document is 26
pages (not including mergecode) and contains 50+ numbered paragraphs
(sections) many of which are conditional. This makes renumbering the entire
document every time I have a conditional paragraph undesirable. I have tried
the {SEQ} method of numbering (which doesn't like IF statements) as well as
normal autonumbering. Nothing has worked for me. Please help, I am running
out of aspirin.

Thx

My Document is laid out as such:

1) unconditional
2) unconditional
3) conditional
4) unconditional
5) conditional
6) conditional
7) unconditional...and so on


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.