Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2008

Tip: Looking for answers? Try searching our database.

Removing spaces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christine - 08 Feb 2008 19:16 GMT
I'm not sure I've been able to find my exact situation so I hope I'm not
duplicating questions. I've seen some solutions that seem close to what I'm
looking for but they look much more complicated than what I think I need.

Here is the problem. I have a Word main merge document with the following
text relating to client phone numbers:
Home:
Cell:
Work:

The phone number source info is from an Access database. In many cases, I
don't have all of the client's phone numbers and if a number does not exist I
would like the line to disappear. For example, I want this appearance

Home: 555-5555
Work: 555-1111

when I don't have a cell number.

Is there a simple way to do this?

Thanks for your help.
Rich/rerat - 09 Feb 2008 04:50 GMT
Christine,
Try inserting the following, if you are using a field called "cellphone".

{if{Mergefield cellphone}<>"" {Mergefield cellphone} \b "Cellphone: " ""}
Make sure you add a space after the colon (:) and the quote marks (")

Remember you need insert the field, you cannot just type "{}".

Signature

Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat
(RRR News)    <message rule>
<<Previous Text Snipped to Save Bandwidth When Appropriate>>

I'm not sure I've been able to find my exact situation so I hope I'm not
duplicating questions. I've seen some solutions that seem close to what I'm
looking for but they look much more complicated than what I think I need.

Here is the problem. I have a Word main merge document with the following
text relating to client phone numbers:
Home:
Cell:
Work:

The phone number source info is from an Access database. In many cases, I
don't have all of the client's phone numbers and if a number does not exist
I
would like the line to disappear. For example, I want this appearance

Home: 555-5555
Work: 555-1111

when I don't have a cell number.

Is there a simple way to do this?

Thanks for your help.
Christine - 11 Feb 2008 00:06 GMT
Thank you, Rich. I've tried this but it won't work. I've evidently got
something wrong. I copied your formula exactly, except I changed the field
name to Cell which is the fieldname in the table. Then I pasted the formula
into the merge doc after the field 'Cell'. Actually, I tried a number of
variations of placement but didn't get anywhere. Can you tell me where I
insert the formula exactly?

Thank you,
Christine

> Christine,
> Try inserting the following, if you are using a field called "cellphone".
[quoted text clipped - 27 lines]
>
> Thanks for your help.
Rich/rerat - 11 Feb 2008 04:47 GMT
Christine,
Sorry I gave you the wrong information.

In the word document, Set up the merge for a directory, use Access as you
database.
Insert the fields for:
<<Name>>
<<Home>>
<<Cell>>
<<Work>>

Now Right click each phone field> Select Toggle Field Codes, and add the
following switch:
\b "FieldName: "

So you will have the following in your document:
<<Name>>
{Mergefield Home \b "Home: "}
{Mergefield Cell \b "Cell: "}
{Mergefield Work \b "Work: "}
<Space> (This will separate each Record when the Merge is finished)
<Space>
Then Merge to New Document

Signature

Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat
(RRR News)    <message rule>
<<Previous Text Snipped to Save Bandwidth When Appropriate>>

Thank you, Rich. I've tried this but it won't work. I've evidently got
something wrong. I copied your formula exactly, except I changed the field
name to Cell which is the fieldname in the table. Then I pasted the formula
into the merge doc after the field 'Cell'. Actually, I tried a number of
variations of placement but didn't get anywhere. Can you tell me where I
insert the formula exactly?

Thank you,
Christine

> I'm not sure I've been able to find my exact situation so I hope I'm not
> duplicating questions. I've seen some solutions that seem close to what
[quoted text clipped - 21 lines]
>
> Thanks for your help.
Christine - 11 Feb 2008 17:02 GMT
Hi, Rich.
Well, I finally got this to work. I'm so grateful for your help. Thank you!
Everything is working as expected - there's just a little glitch with spacing
between the field name and contents when the phone number is there but I can
work with that by using extra spaces in the code and get it pretty close to
the appearance I want. Howeve, if you know of any other magic that might
correct this, I'd be happy to hear about it. Otherwise, it's great.

Thanks again!
Christine

> Christine,
> Sorry I gave you the wrong information.
[quoted text clipped - 55 lines]
> >
> > Thanks for your help.
Rich/rerat - 11 Feb 2008 18:33 GMT
Christine,
So you will have the following in your document:
<<Name>>
{Mergefield Home \b "Home: "}
{Mergefield Cell \b "Cell: "}
{Mergefield Work \b "Work: "}
<Space> (This will separate each Record when the Merge is finished)
<Space>

What you can now do is add an "IF" field to each line:
1. First one at a time, right click each field, Toggle Field Code, and
delete the switch, "\b "fieldname: ".
2. Mouse click, right at the beginning of the mergefield you created.
3. Select the Mergefield toolbar> Insert Word Field> Select "If.., then"
wizard> so for the Home phone line you would do:
If Field Home "Is Not Blank"> In the first text box type "Home:" (w/o
quotes). 4. Now press the TAB button twice (x2), this will move the
mergefield for the number to the right.
5. Repeat steps #3 & #4, for the other phone fields. You can also do this
for the NAME: line to.

So it would something like this

{if.., then...}        {mergefield name}
{if.., then...}        {mergefield home}
{if.., then...}        {mergefield cell}
{if.., then...}        {mergefield work}

Name:              John
Cell:                 555-1236

Name:              sally
Home:              555-1236
Work:              555-1238

Name:              donna
Home:              555-1237
Cell:                 555-1238
Work:              1-554-555-1239

Name:              harold
Cell:                 555-1239
Work:              555-1240

Name:              sammy
Home:              555-1239
Cell:                 555-1240

Name:              Mrs Smith
Home:              1-201-356-2519
Cell:                 1-201-356-2520
Work:              1-201-356-2521

Now this will still align the data left to right. So for the phone #'s, you
may need to make sure that the data is in the same format. So if use area
codes for long distance #'s, you will need to use them for the local
numbers, if you want to keep the alignment. But not necessary. Also for the
"Title" of the
line, I would recommend that you capitalize the whole word, since you are
using just 4 letters for the "Title". You may have to experiment with
different fonts to get the desired effect that you want. It might not be
perfect, but you can get close to what you want. As seen in my example
above, but some of the formatting is lost because the message is in Plain
Text, and the message was created in Georgia font.
Signature

Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat
(RRR News)    <message rule>
<<Previous Text Snipped to Save Bandwidth When Appropriate>>

Hi, Rich.
Well, I finally got this to work. I'm so grateful for your help. Thank you!
Everything is working as expected - there's just a little glitch with
spacing
between the field name and contents when the phone number is there but I can
work with that by using extra spaces in the code and get it pretty close to
the appearance I want. However, if you know of any other magic that might
correct this, I'd be happy to hear about it. Otherwise, it's great.

Thanks again!
Christine

> > "Christine" <Christine@discussions.microsoft.com> wrote in message
> > news:4D5B69D3-BAB7-4751-A376-CCF7A5D9F21A@microsoft.com...
[quoted text clipped - 26 lines]
> >
> > Thanks for your help.
Graham Mayor - 11 Feb 2008 07:42 GMT
You cannot paste fields. Fields brackets {} must be inserted with CTRL+F9

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Thank you, Rich. I've tried this but it won't work. I've evidently got
> something wrong. I copied your formula exactly, except I changed the
[quoted text clipped - 46 lines]
>>
>> Thanks for your help.
Christine - 11 Feb 2008 17:04 GMT
Hi, Graham. Thank you so much for this note.
Christine

> You cannot paste fields. Fields brackets {} must be inserted with CTRL+F9
>
[quoted text clipped - 48 lines]
> >>
> >> Thanks for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.