advanced document coding for word merges - needles.com file · web viewadvanced document coding for...

26
Needles Article ADVANCED DOCUMENT CODING FOR WORD MERGES Once you have mastered the basics of creating a form file, you will come across examples of variable information that must appear in the document in a specific format. This Needles Point explains the finer points of more advanced document merge codes/scripts. When using Word 2007, you will need to customize the Quick Access Toolbar to create many scripts General Information When you view this document in Word, you may be unable to view the coded examples. If you cannot view the codes, press Alt + F9. If you wish to automatically view the field codes when you open Word, from the main menu, click on Tools > Options > View. Select the checkbox Field codes; click on OK. When using Word 2007, click on the Office Button > Word Options > Advanced > Show Document Content > Show Field Codes Instead of Their Values and Field Shading > Always and click OK. To include the field codes when you print a document, from the main menu click on Tools > Options > Print > select the checkbox Field codes. Make sure you turn the print function off when you are printing your merged documents; otherwise some fields (for example, the date) will print as a code. When using Word 2007, click on the Office Button > Word Options > Advanced > Print > Show Field Codes Instead of Their Values. Spaces and punctuation must be properly placed within the code statements. Within any coded document you cannot use double quotes (“”) in the body of the letter, or Word processes the double quotes as merge fields. Instead, use two single quotes in the document. Word limits the number of IF statements that can be used in any one coded statement to twenty (20). Shortcut Files To simplify the process of recreating complicated codes, create a “shortcut” folder containing examples of codes from this handout or simply cut and paste the codes directly from this handout. The following steps will help you create a shortcut. 02/15/2013 www.needles.com Page 1

Upload: dangdan

Post on 02-May-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

ADVANCED DOCUMENT CODING FOR WORD MERGES

Once you have mastered the basics of creating a form file, you will come across examples of variable information that must appear in the document in a specific format. This Needles Point explains the finer points of more advanced document merge codes/scripts. When using Word 2007, you will need to customize the Quick Access Toolbar to create many scripts

General Information

When you view this document in Word, you may be unable to view the coded examples. If you cannot view the codes, press Alt + F9. If you wish to automatically view the field codes when you open Word, from the main menu, click on Tools > Options > View. Select the checkbox Field codes; click on OK. When using Word 2007, click on the Office Button > Word Options > Advanced > Show Document Content > Show Field Codes Instead of Their Values and Field Shading > Always and click OK.

To include the field codes when you print a document, from the main menu click on Tools > Options > Print > select the checkbox Field codes. Make sure you turn the print function off when you are printing your merged documents; otherwise some fields (for example, the date) will print as a code. When using Word 2007, click on the Office Button > Word Options > Advanced > Print > Show Field Codes Instead of Their Values.

Spaces and punctuation must be properly placed within the code statements. Within any coded document you cannot use double quotes (“”) in the body of the letter, or Word processes the double quotes as merge fields. Instead, use two single quotes in the document.

Word limits the number of IF statements that can be used in any one coded statement to twenty (20).

Shortcut Files

To simplify the process of recreating complicated codes, create a “shortcut” folder containing examples of codes from this handout or simply cut and paste the codes directly from this handout. The following steps will help you create a shortcut.

Select and copy a portion of a document that contains the desired coding. (e.g. “Re” line in a letter).

Open a new blank document. Edit > Paste the selected codes into the document.

Change the field code numbers to the # symbol, e.g. «#». The # symbol serves as a placeholder for the new field code.

Click on File > Save. Save the file to a Shortcut folder within the Needdoc folder. e.g. g:\needdoc\shortcut\re.

To insert these files into a new document:

02/15/2013 www.needles.com Page 1

Page 2: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

From the main menu click on Insert > File, browse for and select the shortcut file.

Click on Insert.

Replace the # symbol(s) within the new document to reflect the appropriate field numbers.

Current Date

To insert the current date in the document – copy and paste the following date code:

May 14, 2023DATE

Bar Code

To insert a USPS bar code for the zip code:

Using Fill-ins

Periodically, the United States Postal Service (USPS) changes the way it calculates postal bar codes. When this happens, bulk mail that uses the bar codes generated by Word may not be accepted by the USPS. To avoid providing bar codes that may become obsolete, Microsoft has removed this feature from Office Word 2007 and 2010.

Alternative

Your bulk mailing can still qualify for a discount, but you must work with a third-party provider and the USPS.

Prepare a bulk mailing

This procedure provides general steps to follow. For more information about how to qualify for a bulk mailing discount and discount mailing services for businesses and organizations, go to the USPS Web site.

1. Have your address list verified with the USPS through a third-party service provider.

For information about third parties that provide this service, visit the Microsoft Office Marketplace on the Microsoft Office Online Web site.

2. Assemble your bulk mailing.

3. Use the bar code that is provided when your list is certified.

4. Sort the mail according to USPS requirements.

______________________________________________________________________________

Using Fill-Ins

02/15/2013 www.needles.com Page 2

Page 3: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

A Fill-in is used to insert information that is not contained in Needles and must, therefore, be typed in on a document-by-document basis. When you perform a merge, this command pauses the merge and waits for the user to enter information from the keyboard. To create a Fill-in:

Click on the button, select Fill-in or in Word 2007 Rules

In the Prompt field, enter the prompt information (i.e. Enter date of hearing) then click on OK.).

Click on OK. An example of your prompt is displayed; click on OK. The prompt may be edited within the form.

Hint: Use Fill-ins within If…Then…Else statements to indicate Needles fields that have not been filled in. i.e.

If…Then…Else

The “If …Then . . . Else” code is the most commonly used advanced code for Needles Word merges. The statement creates a comparison between variables and inserts the appropriate text as a result of the comparison.

Click on Insert Word Field > If Then Else. In Word 2007, click on Rules > If Then Else.

If:

In the Field Name field, select the next consecutive field number from the Field name drop down menu box.

Select a Comparison from the drop down menu box.

In the Compare to field, enter a value.

Then:

In the Insert this text field, enter the text that should appear in the document, if the above conditions are met.

Else:

In the Otherwise insert this text field, enter the default information that will be entered if the above conditions are not met. The else field can also remain blank.

Example 1: If the Needles field “Our Client” is checked, “Plaintiff” is inserted into the document; otherwise “Defendant” is inserted.

Field name: «f2»

Comparison: Equal to

02/15/2013 www.needles.com Page 3

Page 4: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Compare to: Y

Insert this text:Plaintiff

Otherwise insert this text: Defendant

The final coding displays as follows:

The statement functions as follows:

If merge field 2 (our client) equals yes, put in plaintiff; otherwise put in defendant.

Example 2: A field must be singular or plural (i.e. child or children), depending on the case information in a Needles field (i.e. Number of Children).

Field name: «f2»

Comparison: Greater than

Compare to: 1

Insert this text:Children

Otherwise insert this text: Child

The resulting coding displays as follows:

.

The statement functions as follows: If merge field 2 (number of children) is greater than 1 put in children; otherwise put in child

IF Statements using Fill-Ins

A combination of an If statement and a Fill In prompt can even be used within an If statement, as displayed in the two examples below.

The statement functions as follows: If merge field 2 (Claim Number) is not blank, the Claim Number is inserted into the document; otherwise, if there is no data in that field, the “fill-in” prompt appears for the user to type in the Claim Number or request the recipient provide the Claim Number, by typing in “Please provide”. If nothing is entered in the fill in and the user clicks OK, the default text: “Unknown” is inserted.

______________________________________________________________________________

States

02/15/2013 www.needles.com Page 4

Page 5: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Date

January 1, 2010

«f4»

____________________________________________________________________________

02/15/2013 www.needles.com Page 5

Page 6: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Coding Full Names

The Needles merge field “full name” includes first name, middle initial, last name, and suffix. If the firm includes prefix in the addressee line, you must insert both the prefix field code and the full name field code.

Prefix:

Full Name: «f3»

The resulting coding displays as follows:

«f3»

The statement functions as follows: If merge field 2 (prefix) is not equal to blank (i.e. there is a prefix), put in merge field 2 (prefix) space, otherwise put in nothing. Merge field 3 (full name).

Inserting Gender-based Pronouns (He/She, etc.)

To insert gender-based pronouns in a form document, code the following If…Then…Else statement. This statement looks first at the party or provider’s Person field (f2) to determine whether they are a person or company, then to the individual’s Sex field (f3 in the examples below) to determine the appropriate pronoun. Note that in this example, if the individual’s sex has not been indicated in Needles (left blank), a Fill-in prompt appears by default. You may need to edit the field number to correspond to the Needles parameters for the party or provider’s Person and Sex fields in your document.

He/She

Him/Her

His/Her

02/15/2013 www.needles.com Page 6

Page 7: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Salutation

Coding a document to include the salutation if it is not blank.

For Party or Provider:

This reads as follows: Put in merge field 2 (salutation). But if merge field 2(salutation) is blank, put in merge field 3(prefix) and merge field 4(last name). But if merge field 3 (prefix) is blank, put in Sir/Madam.

Typist Initials

To automatically insert the typist initials at the end of a form:

There is a one time setup at each workstation in Word:

From the main menu click on Tools > Options > select User Information tab. When using Word 2007, Word Options > Popular.

Enter the user’s full name and lower case initials. (Note: E-mail address, title, staff position, etc. may be substituted for full name).

Click on OK.

From the main menu click on Insert > Field.

In the Categories field, click on User Information.

In the Field names field, click on User Initials.

Click on OK.

The final result displays as follows:

bmb

Add a merge field and the final result displays the Staff Code\Typist Initials

«F2»\bmb

Include Text

INCLUDETEXT coding is used for commonly referenced text that appears in various documents. For example, an included text file can be a letterhead. This code statement enables you to manage firm changes by updating a single location, without updating each and every form file.

The included text is located in a separate document. If you change the document with the ‘compare’ code, every document that uses the INCLUDETEXT coding for that document will incorporate the changes.

Word limits the number of IF statements that can be used in any one coded statement to twenty (20). This limit may require you to separate your INCLUDETEXT coding into individual statements for different groups (i.e. attorneys, paralegals, secretaries, etc.).

02/15/2013 www.needles.com Page 7

Page 8: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

First, create the file that contains the commonly used text. For example, refer to the above example on inserting the staff position. Save the file in the same location as the other documents and shortcuts.

Then, open the file in which you wish to include the text and locate the insertion point at the appropriate place. From the main menu:

Click on Insert > Field. Select Links and References > IncludeText.

Enter the path in quotes next to INCLUDETEXT in the dialog box.

Replace single backslashes with double backslashes to specify the path.

Click on OK.

{ INCLUDETEXT " G:\\Needdoc\\StaffInitials.doc" \*MERGEFORMAT }

______________________________________________________________________________

Using Include Text to Insert from Multiple Letterheads

Error! Not a valid filename.Error! Not a valid filename.Error! Not a valid filename.

Insert Letterhead from an “Ask” Prompting Question:

1Charlotte Office

1Hickory Office

1Gastonia Office

To use either of the above letterhead methods, change the path of the three letterheads after the INCLUDETEXT. Make sure to keep the double backslash (example, \\) and keep the exact path in correct spacing and correct case.

______________________________________________________________________________

02/15/2013 www.needles.com Page 8

Page 9: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Use the NEXT Command in a Table to Select Multiple Items

This function will allow you to Control Click specific names from a List Tab such as Medical Providers. Setting up a table with 20 rows will assure you that all the Providers Selected will be merged. If you think you might sometime have 40 Medical Providers – just add 20 more rows to the master.

Take note: If you select 3 names to merge, you will have to delete the extra rows after the merge.This table has to be the last data to be merged into the document.Use Border and Shading to deselect the border.

«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»«F11»«F13»

02/15/2013 www.needles.com Page 9

Page 10: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Use the NEXT Command in a Table to Select Multiple Items and Sum the Total

Specials Code Provider Amount

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

«F12» «F13» «F14»

TOTAL SPECIALS: ** Expression is faulty **

Inserting the Ordinal Date

Legal documents often refer to dates in ordinal formats. Needles merges a date field into MM/DD/YYYY format (e.g. 02/24/2000). To change the format:

Insert the Merge Field that corresponds to the Needles date.

1st Example: February 24, 2004:

From a Needles date field:

«f2»

From the current system date:

May 14, 2023DATE

2nd Example: the twenty fourth day of October two thousand

From a Needles date field:

the «f2» day of «f2» «f2»

02/15/2013 www.needles.com Page 10

Page 11: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

From the current system date:

the 14DATE day of MayDATE 2023DATE

3rd Example: October eighth one thousand nine hundred ninety-eight

From a Needles date field:

«f2» «f2» «f2»

From the current system date:

MayDATE 14DATE 2023DATE

4th Example: The 31st day of December, 2004

From a Needles date field:

the «f2» day of «f2»

From the current system date:

the 14DATE day of May, 2023DATE

02/15/2013 www.needles.com Page 11

Page 12: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Multiple Addressees

A merge letter may need to be sent to three addressees and all the addresses must be on one letter. This code involves If…Then…Else statements. If there are less than three addresses chosen, the blank space will not appear.

«f2»

«f3»

In the example above, the letter is being sent to three attorneys therefore, field 2 is Counsel #1 full name, field 3 is default full address, field 4 – Counsel #2 is full name, field 5 is default full address, field 6 is Counsel #3 and field 7 is default full address.

The following example allows the selection of an address from Home, Business and Other AND includes the Salutation for each of those addresses (Needles allows a separate salutation for each address per Party/Provider).

111

Dear 1Sir/Madam1Sir/Madam1Sir/Madam:

The codes are translated as follows: Under the ASK command, if 1 is selected, the full name and home address is entered; if 2 is selected the full name and business address is entered; if 3 is selected the full name and other address is entered. Then based on the selections, the salutation will be entered if there is data in that field for each address – the salutation represented by fields 5, 9, and 11. If there is no salutation, but there is a prefix, then the prefix and last name (fields 6 and 7) are entered. If there is no salutation and no prefix, Sir/Madam is entered.

______________________________________________________________________________

02/15/2013 www.needles.com Page 12

Page 13: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Bookmark

The purpose of this function is to be prompted by an Ask field for information that is not available in Needles, but will be used by means of the Reference code several times throughout the document. This information may be used 50 or more times in a document.

Create and define the Bookmark:

Make sure the insertion point of the Ask statement is placed at the beginning of the document. Click on the Insert Word Field button > Ask. In the Bookmark field, enter in name of the bookmark (This is used for coding purposes only. The name given can be arbitrary - in this example the name of the bookmark is bookmark).

Enter the Prompt (these are instructions for the user); select the Ask once checkbox; then click on OK.

The newly created prompt will appear.

Click OK.

The resulting code displays as follows:

Reference the Bookmark (these are all the places within the merged document where the results will appear). Select the very first insertion point in the document where you will need to reference the bookmark. From the menu, select Insert > Field.

In the Categories field, select Links and References;

In the Field names field, select Ref – you can format the prompt at this point. Perhaps you will need the information the typist enters to appear in CAPS, if so, Click on Format, Uppercase; then click on OK.

02/15/2013 www.needles.com Page 13

Page 14: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

The resulting code displays as follows:

Error: Reference source not found

With the curser inside the brackets and after the ‘REF’, enter the name given to that bookmark.

The final code displays as follows:

Copy this statement to each place in the document that it should appear.

Ask Statement

The “Ask” merge field is used to create a menu in a merge document (e.g., Should this letter be in English, Spanish, or French?) This is a four-step process

Step 1

From the main menu, select Insert > Field > All >Ask. See Figure 1.

In the field after “ASK”, enter the reference and menu selection. Include quotes around the menu selection as shown in Figure 1.

Click on OK.

02/15/2013 www.needles.com Page 14

Figure 1

Page 15: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

The resulting coding displays as follows:

The statement functions as follows:

When Word finds the bookmark “Language”, you are prompted to select the language from the numbered menu.

Step 2

Create the Reference. From the menu, select Insert > Field > All > Ref; click on OK. See Figure 2.

The reference word (Language) must be identical to the Bookmark in the “ASK” statement above.

The resulting coding displays as follows:

Step 3

Create an If…Then…Else statement to get the results of the menu selection. Click on Insert Word Field. Select If…Then…Else; use F2 as a reference marker and enter 1 in the Compare to field. In the Insert this text field, enter text as a place marker. (e.g., “English version of letter”; after you create the code statement, replace “English version of letter” with the actual text of the letter.)

Click on OK.

The resulting coding displays as follows:

02/15/2013 www.needles.com Page 15

Figure 2

Figure 3

Page 16: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Step 4

Replace the «f2» with so that the statement displays as follows:

Create an If…Then…Else statement for each version of the letter in the document. Each statement must be embedded into the last set of quotes of the previous If…Then…Else statement. For example:

Removing Blank Lines

To remove blank lines in your merge codes, for example, there are several items that you wish only those selected to be listed:

Example:

INJURIES ICD-9 CODE

{IF{MERGEFIELD F10}=”Y” “Ankle Pain 719.47” “”}

{IF{MERGEFIELD F11}=”Y” “Backache 724.5” “”}

{IF{MERGEFIELD F12}=”Y” “Cervical Sprain 847.0” “”}

Turn on the paragraph marker

Move the paragraph markers that appear outside the brackets inside your code.

Example:

INJURIES ICD-9 CODE

{IF{MERGEFIELD F10}=”Y” “Ankle Pain 719.47

” “”}{IF{MERGEFIELD F11}=”Y” “Backache 724.5

” “”}{IF{MERGEFIELD F12}=”Y” “Cervical Sprain 847.0

” “”}

02/15/2013 www.needles.com Page 16

Page 17: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Certification of Service

The Counsel Tab in each case has a Cert/Notice Filing Order field. You can assign each counsel a number. The Full Name and Default Address of each Counsel will merge into the document in either Paragraph or Line format.

The single Word field code, as seen below, will pull the counsel names and address.

Go to Needles, Directory, Document Set up, Select a Group:

Select Merge Parameters from Select a Field:

Cert/Notice Paragraph Format

Cert/Notice List Format.

You may need to edit the field number to correspond to the Needles Merge Parameters.

CERTIFICATE OF SERVICE

The undersigned hereby affirms that a copy of the foregoing pleading has been sent by U.S. Mail with adequate postage attached, addressed to the following:

«f9»

______________________________________________________________________________

02/15/2013 www.needles.com Page 17

Page 18: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

Zero Date Code for Word

Where Case Open Date (or any DATE field) = «F2»

Use this instead of IF BLANK for Zero Dates and Alternate Text:

Switches

Switches are instructions that modify the format of the information that results from a field. Switches are indicated by a slash (“\”) followed by instructions. To include a switch, add the following codes after the merge code within the field code brackets.

Ordinal text

\* OrdText

In this example, F2 (18) was pulled from a field called date in month.

The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example,

«F2» displays "eighteenth", or«F2» displays "Eighteenth".

Ordinal arabic text

\* Ordinal

For example, 30 using this switch «f3» displays as "30th".

Dollar text

\* DollarText

In this example, the dollar amount appeared in Needles as $15, 999.32

Word inserts "and" at the decimal place and displays the first two decimals (rounded) as arabic numerators over 100. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, «F4» displays as "fifteen thousand nine hundred ninety-nine and 32/100".

Capitalization

\* Caps

Capitalizes the first letter of each word. For example,

{ FILLIN "Type your name:" \* Caps } displays "Julie Tanner" even if the name is typed in lowercase letters.

\* FirstCap Capitalizes the first letter of the first word. For example,

{ COMMENT \* FirstCap } displays "Weekly report on sales".

\* Upper Capitalizes all letters. For example,

{ QUOTE "word" \* Upper } displays "WORD".

02/15/2013 www.needles.com Page 18

Page 19: Advanced Document Coding for Word Merges - needles.com file · Web viewAdvanced Document Coding for Word Merges. Once you have mastered the basics of creating a form file, you will

Needles Article

\* Lower All letters are lowercase. For example,

{ FILENAME \* Lower } displays "weekly sales report.doc".

\* MERGEFORMAT Applies the formatting of the previous result to the new result. For example, if you select the name displayed by the field

{ AUTHOR \* MERGEFORMAT } and apply bold formatting, Word retains the bold formatting when the field is updated when the author name changes.

02/15/2013 www.needles.com Page 19