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 / November 2006

Tip: Looking for answers? Try searching our database.

More than one formatting switch for a merge field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sch06 - 01 Nov 2006 18:52 GMT
Can I use more than one switch for a merge field, and if so, is there a
proper order I must use?  Currently I'm trying to use the  \# and \b
switches.  It's showing the \b text, but not formatting the numbers when I
merge.
Doug Robbins - Word MVP - 01 Nov 2006 19:23 GMT
It would be easier to give you the information that you are asking for if
you said:

1.    What it is the datasource
2.    How the information appears in the data source
3.    How you want it to appear

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Can I use more than one switch for a merge field, and if so, is there a
> proper order I must use?  Currently I'm trying to use the  \# and \b
> switches.  It's showing the \b text, but not formatting the numbers when I
> merge.
sch06 - 01 Nov 2006 19:43 GMT
1.  The datasource is .xls
2.  It was originally imported from AS400 and so all the fields are text
fields
3.  However I need some of them to appear as currency with dollar signs,
commas, two places after decimal points.  Also, if the merge field isn't
blank, I need text to appear before it.

I had tried just importing the datasource via DDE (would have solved both
problems since I would have only needed the \b switch), but my computer
freezes everytime I merge when using that method.  And I have plenty of RAM,
so I'm not sure what the problem is there.
Thanks!

> It would be easier to give you the information that you are asking for if
> you said:
[quoted text clipped - 7 lines]
> > switches.  It's showing the \b text, but not formatting the numbers when I
> > merge.
Doug Robbins - Word MVP - 01 Nov 2006 20:07 GMT
See "Formatting Word fields with switches" on fellow MVP Graham Mayor's
website at

http://www.gmayor.com/formatting_word_fields.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> 1.  The datasource is .xls
> 2.  It was originally imported from AS400 and so all the fields are text
[quoted text clipped - 22 lines]
>> > when I
>> > merge.
sch06 - 01 Nov 2006 20:19 GMT
Thanks, I had consulted that site as well as this one already but couldn't
find anything on either about using two switches for one mergefield and
proper order for doing so.

> See "Formatting Word fields with switches" on fellow MVP Graham Mayor's
> website at
[quoted text clipped - 27 lines]
> >> > when I
> >> > merge.
Doug Robbins - Word MVP - 02 Nov 2006 05:41 GMT
As the \b switch inserts a POSTNET bar code, I can't imagine what it is that
you are trying to do.   As far as the text before a field if it is not
blank, you should be using an { IF } field construction for that.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Thanks, I had consulted that site as well as this one already but couldn't
> find anything on either about using two switches for one mergefield and
[quoted text clipped - 37 lines]
>> >> > when I
>> >> > merge.
Peter Jamieson - 02 Nov 2006 11:18 GMT
> Can I use more than one switch for a merge field,

Usually.

> and if so, is there a
> proper order I must use?

In some cases. (There are one or two switches that have to go at the end,
but otherwise, sequence does not usually matter)

> Currently I'm trying to use the  \# and \b
> switches.  It's showing the \b text, but not formatting the numbers when I
> merge.

Imagine you apply the \b switch. Then the \# operates on the result, as far
as I know. So if myfield contains 1.234,

{ MERGEFIELD myfield \#0.0 }

should give you 1.2

{ MERGEFIELD myfield \b "myfield: " }

should give you

myfield: 1.234

but when you apply \#0.0 to "Number: 1.234", the switch actually ignores the
non-numeric characters and gives you 1.2. So both switches are being
applied, but not with the effect you probably hoped for, i.e. that the \# is
applied first and the \b after.

If that is what you want, then what to do depends on exactly whan can be in
myfield and how you want it displayed. For example, suppose myfield could
have the following types of content:
1. numeric, non-zero, e.g. 1.234
2. numeric, zero, e.g. 0
3. blank (could come from a numeric column where Word or the data source has
not substitued a "0"), i.e. ""
4. nonblank, non-numeric, e.g. "abc"

Using \b and \# suggests you want the following:

1. myfield: 1.2
2. myfield: 0
3. (blank)
4. myfield: abc

To get that, you will probably have to use a nested IF field (sorry, no time
for an example right now!)

If you just want 1,2, and 3 (i.e. you know the value is numeric or blank)
you can probably use

{ MERGEFIELD myfield \#"'myfield: 0.0'" }

Peter Jamieson

> Can I use more than one switch for a merge field, and if so, is there a
> proper order I must use?  Currently I'm trying to use the  \# and \b
> switches.  It's showing the \b text, but not formatting the numbers when I
> merge.
 
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.