Link to home
Start Free TrialLog in
Avatar of GlobexCorp
GlobexCorp

asked on

Include carriage return in mail merge?

Is it possible to add something into a mail merge which inserts a new line?  

We are trying to force people in our organisation to follow strict guidelines when writing letters.  I have written a little application in Delphi which accepts input such as recipient, address, signature, cc etc and sticks it into a table in a html file.  My template then reads this html file and merges it to create the document. My problem lies here:  there are some fields, for example, sent by fax, which will only be included if a checkbox is selected.  Currently, if this is not included, my word document leaves too big a gap where I've pencilled it in.  I'd like to change the word doc so that the merge pulls in all the 'optional extras' on the same line as what comes after it, and then include a carriage return in the table where it pulls the data in from.  That way, if the item isn't included, nothing will be added and I won't have extra white space.  Is it possible?  I also have areas where I'd like to add tab characters.  

I hope you can help me, this is driving me nuts :)  If my description of the problem isn't clear enough, please let me know what I need to clarify and I will!

Thank you!  
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GlobexCorp
GlobexCorp

ASKER

Graham,

Thanks for the help!

That helps to a point, but there is an area between address and body of letter where you could have anywhere between one and five lines of text, each seperated by a blank line.  I can't insert the blank line without having a gaping blank area in the completed document if there is only one line...  see example below, imagine this is my word document:

Address

Attn: Joe Smith

Sent by fax: 0800 123456

Sent by courier: SDS

Sent by Email: info@company.com

Re: Subject of the letter

Dear sir,


Only the address, the dear sir and the Re: lines are required, the rest are optional.  If I don't use them, my document looks like this:

Address




Re: Subject of Letter

Dear Sir,

I need the lines between them to go away if the item isn't used.  Sorry my description is so unclear, its too late in the week for speaking proper english, my brain is fried :)  
Just jumping in with a thought - Are you using the addressblock field?
http://wordprocessing.about.com/od/usingmailmerg1/l/blOutlookmerge3.htm
No, because of the variations involved in how the letter goes out, I just manually entered the various fields.  
I added on to Grahams initial suggestion - put each entry on a seperate line with no blank line between them, then I solved it on the html side - entered a br tag after each entry which resolved the issue.  So now if it is blank it is skipped, but if there is something in there, it skips two lines.   I'm so dim it scares me sometimes.  Thanks, folks!  
Another way could have been to format the optional paragraphs with extra space afterwards instead of having an extra empty paragraph.