Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging to word without merging empty fields

Status
Not open for further replies.

amills

Programmer
May 30, 2003
22
0
0
US
I have a dbf file that I merge with that has address1 and address2. If address2 is empty I don't want it to print a blank line before it prints the city,state and zip line. In the Word Merge wizard I can select that setting in my form letter, but once I execute my merge through VFP it doesn't stay set. Any suggestions ?


Andy
 
Hi Amills,

Are you using VFP frx files or exporting data from dbf to word mail-merge utility ?

In vfp's frx file you can check as true the option of &quot;Remove line if blank&quot; and &quot;Print only when <>''&quot;.

I have provided mail-merge facility that way. It works fine except that formating is fixed for the letters.

Puru
 
I'm exporting from dbf to word mail merge. When I created the form document and attach a data source to it in word and merged it worked fine. It had an option to check to not print empty fields. When I go back to it after my program has run a merge. That option isn't checked anymore.

Andy
 
In your word document that you are using to merge put both address1 and address2 on the same line one right after the other. <<address1>><<address2>> Then, in between them insert the IF word field (see mailmerge toolbar in Word)... it will give you a sort of If then else thing to work with.

Put the following values in the dialog box that comes up:
Fieldname: address2
Comparison: Equal to
Compare to: (leave blank)
Insert this text: (leave blank)
Otherwise insert this text: (put in a single carriage return)

What happens here, as you may have already guessed is that it will leave the addresses on the same line if address2 is empty, or it will put address2 right below address1 if there is something in that field. Thus giving you what you want.

...the dialog box is pretty similar between versions of word, but if your version of word is significantly different please post back.

This is not really a VFP question as much as it is a Word question. But I hope this gets it working for you.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
amills,

Did the above solution work for you?

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top