upper case words automatically

A

Associates

Hi,

I was wondering if anyone might be able to help me here. In word 03, is
there a way for word to recognise a word and change it to something we want.
For example, there are certain words like JBH, COM that i want Word to
automatically detect and change them to Upper case letter. So user may type
them in all in lower case such as jbh but Word would turn it to JBH as it
goes. Is there a way of getting around this or that it involves programming
codes.

Any helps would be greatly appreciated.

Thank you in advance
 
D

Doug Robbins - Word MVP on news.microsoft.com

Set up AutoCorrect entries that replace the lower case with the upper case.

--
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, originally posted via msnews.microsoft.com
 
A

Associates

Hi Doug,

Sorry, just found out that it does not work when user fills out data on the
userform to dump the value to the word document. I have the following code
that puts the value into the word document by means of DOCVARIABLE

With ActiveDocument
.Variables("headingTitle").Value = Me.TX_NameHeading.Text
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With

Is there any way of run autocorrect before the value be put into word
document.

Thank you in advance
 
D

Doug Robbins - Word MVP on news.microsoft.com

To get what is entered into Me.TX_NameHeading in upper case, you can use

With ActiveDocument
.Variables("headingTitle").Value = UCase(Me.TX_NameHeading.Text)
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With

Or if there are some locations where you what it in uppercase and others
where you would want it in lower case, you can add the appropriate
formatting switches to the Docvariable fields

{ DOCVARIABLE headingTitle \* Upper } for UPPER CASE

{ DOCVARIABLE headingTitle \* Lower } for lower Case

{ DOCVARIABLE headingTitle \* FirstCap } for First capital

{ DOCVARIABLE headingTitle \* Caps } for Title case

--
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, originally posted via msnews.microsoft.com
 
A

Associates

Thank you for your reply.

Sorry i think i did not explain myself too well to you. I think the code you
gave will turn any words into uppercase. I suppose what i wanted was to use
the autocorrect feature to uppercase only a certain number of words such as
CHM or OHS, not all the words. Now, autocorrect works as it uppercase the
word 'CHM' when i type in 'chm' in word document automatically. What it does
not work is when the word is entered in via a textbox on a userform to the
document. I have a userform that users need to fill out. Those data will be
put into the document when users click 'OK' button in the userform. Now, some
of the words in the data may consist of special words that i have already
added into autocorrect entry list. Is there any way we can invoke the
autocorrect immediately when the data be dumped into word document.

Hope i explained it clearly to you.

Thank you in advance
 
D

Doug Robbins - Word MVP on news.microsoft.com

You could use an If...End If construction to test for the entry in the text
box and format it as uppercase if it was something to which you wanted that
format applied.

--
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, originally posted via msnews.microsoft.com
 
A

Associates

Thank you Doug for your reply.

Yes, that helps. I will do that as you recommended. That happen to cross my
mind too but before i thought that if there was another easy way (perhaps by
means of the autocorrect)of achieving that, why not give it a try.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top