Prob#2, ProperCase issue 
Author Message
 Prob#2, ProperCase issue

I built a UserForm that has several TextBoxes within it
for things such as Name, Address, etc.  I wanted to change
the format of the text to Proper Case, and used the
VBA "StrConv(TextBox, vbProperCase)" command to accomplish
this.  This worked to change the first letter of every
word to capital case, but it prevents any other letter
from being capitalized.  Hence my users can't type a name
such as McCloud, or even type and address with a state
abbreviation such as CA.  Does anyone know a way to get
the text into Proper Case without preventing another
capitalized letter being put in by the user?  Thanks so
much for your help!


Sun, 25 Jan 2004 22:49:54 GMT  
 Prob#2, ProperCase issue
Hi Cody

You have to write a macro that reads a dictionary (which you could store in
a text file, or hard code, but the former is easier to maintain).

If [word is in dictionary]
    [use capitalisation in dictionary]
Else
   [capitalise it in proper case]
End If

You should also allow for words such as "the", "and" and "is", which should
be in lower case (again, via a dictionary). Proper case does NOT mean First
Letter Of All Words In Caps. It means First Letter of all Important Words in
Caps. (Someone should tell Microsoft this! <g>)

Regards

Dave


| I built a UserForm that has several TextBoxes within it
| for things such as Name, Address, etc.  I wanted to change
| the format of the text to Proper Case, and used the
| VBA "StrConv(TextBox, vbProperCase)" command to accomplish
| this.  This worked to change the first letter of every
| word to capital case, but it prevents any other letter
| from being capitalized.  Hence my users can't type a name
| such as McCloud, or even type and address with a state
| abbreviation such as CA.  Does anyone know a way to get
| the text into Proper Case without preventing another
| capitalized letter being put in by the user?  Thanks so
| much for your help!



Wed, 28 Jan 2004 06:03:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Propercase

2. ProperCase Function/Routine

3. How to change a string to ProperCase

4. changing UPPERCASE to ProperCase

5. prob w var user defined type as class mem ( prob easy for an exp VB OO)

6. Office XP Mail Merge issue Insertdatabase issue and problems with copying a macro

7. Issue 6 and Issue 7 fanzine notes

8. BASIX Fanzine Issue 9 **NEW ISSUE** - basix09.txt (1/1)

9. Stealth64 PCI Video card - my prob or Stealth prob?

10. datedifference programming prob pt2

11. strange focus/control prob on subform

12. prob define 'database'

 

 
Powered by phpBB® Forum Software