Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]() Thanks Mark! The "IF" approach in #1 worked well! It took a little work to get formatting and other embedded fields to work, but the trick, as you mentioned, is to use Ctrl+F9 for any embedded fields. Now in the merged document, I get an extra page break between records...but that's a different problem... Thanks again, Dave "Mark V" wrote: Dave, Just went through this exercise. I've been able to get the spacing to work out using a series of {IF} statements. You have at least three options that you can try: 1. Create and format the paragraph or paragraphs that you want to use. Insert an {IF} statement where you would like these paragraphs to appear (using Control+F9 and typing in the conditional statement between the brackets). Be sure to use Control+F9 to insert any other fields that you want to include in the statement (you can't just type in the brackets). For the THEN and ELSE text in the {IF} statement just put pairs of quotes ("") as placeholders. Your {IF} statment will essentially be {IF condition "" ""}. Leaving the {IF} statement visible (don't Toggle Field Codes or Update Field yet), cut and paste the paragraph or paragraphs created above between the placeholder quotes. Your {IF} statement will now look something like {IF condition "paragraph1 text" "paragraph2 text"}. Keep in mind that the statement won't appear all on one line but will instead look a bit messy and span multiple. Once you've finished pasting in the desired paragraphs, hit F9 to update the field (or right click and select Update Field) and you should see the results. Test the conditional statement and formatting with a data source to be sure that it looks the way you want. If not, you'll have to toggle field codes again to mess around with it. 2. Create a document or documents with the paragraph or paragraphs that you want to use formatted as you'd like them to appear. Save each document and remember the path and file name. Insert your {IF} statement as outlined above but instead of cutting and pasting in paragraphs between the quotes, use the {INCLUDETEXT} field to insert the paragraphs from the documents. Your {IF} statment will look something like {IF condition "{INCLUDETEXT "paragraph1.doc"}" "{INCLUDETEXT "paragraph2.doc"}"}. Check Word help for more info on {INCLUDETEXT} syntax and options, especially how to correctly specify the path. Note: You can also create multiple paragraphs in a single Word doc, create bookmarks for them and refer to the specific paragraphs by using the bookmarks within the {INCLUDETEXT} field. 3. Create and format the paragraph or paragraphs that you want to use. Highlight them and create AutoText entries by selecting Insert, AutoText from the main menu and using an easy-to-remember name for each (don't include any spaces in the AutoText name since the {AUTOTEXT} field that you will use below doesn't like spaces). Insert your {IF} statement as outlined above but put an {AUTOTEXT} field between the quotes instead. Your {IF} statement will look something like {IF condition "{AUTOTEXT paragraph1autotext} "{AUTOTEXT paragraph2autotext"}}. Check Word help for more info on {AUTOTEXT} syntax and options. Hope this helps. Regards, Mark V "Dave" wrote: Hello, I'm developing a word document for use with merge data, and one of the requirements of the document is to conditionally display a paragraph based on the value of a MergeField. I've considered using a sequence of {IF ... } fields, but that is neither elegant nor does it maintain proper paragraph spacing between the paragraph above and below. Any ideas? Thanks, Dave |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple styles in a single paragraph | Microsoft Word Help | |||
How do I use the PRINT field code to ... | Microsoft Word Help | |||
Filename field - display problem with \p option | Page Layout | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help | |||
field calculation error, mailmerge, | Mailmerge |