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 / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Change text to uppercase?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
StargateFanFromWork - 04 Apr 2007 22:26 GMT
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.  :oD
Jonathan West - 04 Apr 2007 22:31 GMT
> 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
[quoted text clipped - 8 lines]
>
> TIA.  :oD

ActiveDocument.Range.Case = wdUpperCase

Signature

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

StargateFanFromWork - 04 Apr 2007 23:32 GMT
>> 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
[quoted text clipped - 10 lines]
>
> ActiveDocument.Range.Case = wdUpperCase

Perfect!  Thanks, Jonathan.  I'll get the hang of it yet.  :oD
Greg Maxey - 04 Apr 2007 22:31 GMT
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

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> 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
[quoted text clipped - 8 lines]
>
> TIA.  :oD
 
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.