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 / August 2004

Tip: Looking for answers? Try searching our database.

If statement using switches in Mergefields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Naina Haria - 12 Aug 2004 14:58 GMT
Dear All

Can anyone out there write an If statement for me please?
This is my problem.  I have a merged word document in
Word97, the data that is merged to the document comes from
a database where the data is keyed in capital letters.
When it is merged to word, all the names and addresses are
in capitals. I have found using the Help file how to add a
switch that will convert the first letter of each word to
capitals but changes all the other letters to lowercase.
The switch is \*Caps.  I now need to write an If statement
that will allow me to do the same with a name that has an
apostrophe in it. For example, Mrs O'Connor. If the
information is merged like MRS O'CONNOR, I want to be able
to add a switch that says if {mergefield
Custsurname\*caps} but if {mergefield O'CONNOR, then
make "O"\*caps and "C"*caps but only when there is an
apostrophe in the name. I have tried writing this code but
not had much luck.

Any one who can give me any assistance, it will be greatly
appreciated.

thanks

Naina
Greg Maxey - 12 Aug 2004 22:51 GMT
Naina,

I don't know if that is possible.  A work around would be a find and
replace.

Edit>Replace>More>Use Wildcards

Type O'[a-z] in the find what field
Type ^& in the replace with field then press Format>Font and check all caps

Replace all.

Signature

Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in gmaxey@whamspammvps.org

> Dear All
>
[quoted text clipped - 22 lines]
>
> Naina
Gert Raes - 13 Aug 2004 12:06 GMT
As I remember correctly there is also a switch "\* Lower"

So it should look like : {mergefield O'CONNOR \*Lower}
(but I'm not sure since I use Word2003

>-----Original Message-----
>Dear All
[quoted text clipped - 25 lines]
>
>.

Rate this thread:






 
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.