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  

Automatically delete a line if nothing on it??



 
 
Thread Tools Display Modes
  #1  
Old April 9th, 2010, 04:18 PM posted to microsoft.public.word.mailmerge.fields
UCHelp[_4_]
external usenet poster
 
Posts: 1
Default Automatically delete a line if nothing on it??


Hey guys,
Is it possible to have MS Word automatically check a line for
characters and then delete that line if no characters are found on it
(except the null / space bar character obviously)?

I am using a Word XML 2003 document to import data and concatenate the
finished product into a word doc for mailing to customers.

For example, if I'm importing this:

{!contact.firstname;}
{!contact.lastname;}
{!contact.title;}

and the database I'm using *only* contains data for the *firstname* and
*title* (doesn't have his last name) of the person, then I'd want it to
print this:

John
Technical Production Assistant

NOT THIS:

John

Technical Production Assistant




So is there some special syntax or command I can put after the
importing element of each line (in the word 2003 xml file), so it will
delete that line if there are no real characters that are merged to it
in the final .doc file?

?




--
UCHelp
  #2  
Old April 9th, 2010, 10:08 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Automatically delete a line if nothing on it??

You asked very similar questions a few days ago and received answers
from myself and Doug.

Maybe you could post back into those threads as to what was wrong, because
a. it's not obvious what is different about what you are attempting now
b. you're using language that you're not explaining - e.g. "I'm importing

{!contact.lastname;}"

Is this a merge field? It certainly doesn't look like a typical one. And
Word can't use XML data sources for mailmerges "out of the box". So are
you doing a mail merge? Or are you doing some kind of XML
transformation? Or what?

The thing is that Word does empty line elimination as standard when it
performs a mail merge /and/ the empty line results from a line that has
nothing but empty { MERGEFIELD } fields (and perhaps in some other
circumstances), but it doesn't have an automatic facility to eliminate
any old empty line, even during a merge.

Peter Jamieson

http://tips.pjmsn.me.uk

On 09/04/2010 16:18, UCHelp wrote:
Hey guys,
Is it possible to have MS Word automatically check a line for
characters and then delete that line if no characters are found on it
(except the null / space bar character obviously)?

I am using a Word XML 2003 document to import data and concatenate the
finished product into a word doc for mailing to customers.

For example, if I'm importing this:

{!contact.firstname;}
{!contact.lastname;}
{!contact.title;}

and the database I'm using *only* contains data for the *firstname* and
*title* (doesn't have his last name) of the person, then I'd want it to
print this:

John
Technical Production Assistant

NOT THIS:

John

Technical Production Assistant




So is there some special syntax or command I can put after the
importing element of each line (in the word 2003 xml file), so it will
delete that line if there are no real characters that are merged to it
in the final .doc file?

?




 




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:06 PM.


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