Change text to uppercase?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

I'm still grappling with vb code. I try to avoid the code that needs
selecting even if the recorded keystrokes give that. How can I get the same
results as below without using "Selection", pls?
****************************************************
Sub Uppercase()
'
Selection.WholeStory
Selection.Range.Case = wdUpperCase
End Sub
****************************************************

TIA. :eek:D
 
J

Jonathan West

StargateFanFromWork said:
I'm still grappling with vb code. I try to avoid the code that needs
selecting even if the recorded keystrokes give that. How can I get the
same results as below without using "Selection", pls?
****************************************************
Sub Uppercase()
'
Selection.WholeStory
Selection.Range.Case = wdUpperCase
End Sub
****************************************************

TIA. :eek:D

ActiveDocument.Range.Case = wdUpperCase


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
G

Greg Maxey

If the cursor is the only indicator of the story that you are in then you
would have to do it something like this:

Sub Test()
ActiveDocument.StoryRanges(Selection.StoryType).Case = wdUpperCase
End Sub
 

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