> I'm trying to do a conditional paragraph Merge that is stumping me. I
> have a column of data in an Excel Spreadsheet that contains numbers
[quoted text clipped - 6 lines]
> to search through a string of numbers or letter and isolate a
> particular one(s)?
Hi Cindy,
Not applicable to the original post, but you might be surprised what can be
done. Try the following:
{QUOTE"The string "{SET ID "1233-45-6789""}{ID}" is made up of "{SET
EXP1{={=-{ID}-ID}/2}}{EXP1}", "{SET EXP2{=({ID}*(-1)-{ID})*(-1)/2}}{EXP2}
, "{SET EXP3{={=-{=-{ID}-ID}/2}-(({ID}*(-1)-{ID})*(-1)/2+{ID})}}{EXP3}}
Just a demo of how to separate out parts of formatted three-segment numbers,
including US Social Security Numbers. By deleting the extraneous text and
string manipulations for EXP1 and EXP2, this might be useful for anyone
doing mailmerges etc where only the last 4 digits can be dispalyed.
Cheers
> Hi Fisher27,
>
[quoted text clipped - 25 lines]
> This reply is posted in the Newsgroup; please post any follow question
> or reply in the newsgroup and not by e-mail :-)
Cindy M -WordMVP- - 18 Dec 2003 17:26 GMT
Hi Macropod,
Makes my head ache <g> Just goes to show how "unpredictably" Word really deals
with strings that contain numbers and mathematical characters <shudder> I'd
almost bet you stumbled on this while trying to sort zip codes...
I have some quibbles with how you address the ID bookmark in a couple of
places (missing field brackets and see below), and I prefer this calculation
syntax for EXP1
{ = -(-({ ID })-{ ID })/2 }
but point taken :-) It's especially shocking to realize that, for Word,
-({ID}) and -{ID} and {ID}*(-1) are NOT the same thing! The first two I can
follow, but the last defies all mathematical logic <sigh> (I can see what's
happening, but WHY it should happen ought to be forbidden!)
About the { ID } construct: Under special circumstances, Word will not
actually use the value you expect in an implicit REF field. A few years ago,
someone was asking why-oh-why they were getting the wrong results for their
"bookmark" DM. Turns out they were in a German locale, and DM was the currency
"symbol" set in Windows. Word was using the currency information instead of
what was being passed into the document by the *mergefield* DM. IOW, withouth
the field name, Word will sometimes give something else precedence. So I've
made it a habit to always include REF (or MERGEFIELD), even if it makes it
more difficult to keep an overview.
> Not applicable to the original post, but you might be surprised what can be
> done. Try the following:
[quoted text clipped - 5 lines]
> string manipulations for EXP1 and EXP2, this might be useful for anyone
> doing mailmerges etc where only the last 4 digits can be dispalyed.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)