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 / Menus and Toolbars / December 2004

Tip: Looking for answers? Try searching our database.

macro command for cursor to jump to end of selection?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
-Steve-Krause- - 09 Dec 2004 20:43 GMT
I have a very simple macro assigned to a button that takes highlighted text
and makes italic and red .

   Selection.Font.Italic = True
   Selection.Font.Color = wdColorRed

I have another macro assigned to a button that turn the text back to my
standard.

   Selection.Font.Italic = False
   Selection.Font.Bold = False
   Selection.Font.Color = wdColorBlack

I have to highlight the text, push the red text button, then move the cursor
to the end of the selection and select the other button to start typing in
the black color.

Is there a way that I can combine these two so that I don't have to move the
cursor manually?

Steve Krause
sk@dolby.com
Greg Maxey - 09 Dec 2004 21:01 GMT
Steve,

I won't say that this can't be improved, but try:

Sub ScratchMacro()
With Selection
   With .Font
       .Italic = True
       .Color = wdColorRed
  End With
       .Collapse Direction:=wdCollapseEnd
End With
With Selection.Font
   .Italic = False
   .Bold = False
   .Color = wdColorBlack
End With
End Sub

Signature

Greg Maxey/Word MVP
A Peer in Peer to Peer Support

> I have a very simple macro assigned to a button that takes
> highlighted text and makes italic and red .
[quoted text clipped - 18 lines]
> Steve Krause
> sk@dolby.com
-Steve-Krause- - 09 Dec 2004 21:43 GMT
Works for me.  Thank you very much.
Steve

> Steve,
>
[quoted text clipped - 37 lines]
> > Steve Krause
> > sk@dolby.com
Jezebel - 09 Dec 2004 22:15 GMT
selection.Collapse Direction:=wdCollapseEnd

> I have a very simple macro assigned to a button that takes highlighted text
> and makes italic and red .
[quoted text clipped - 18 lines]
> Steve Krause
> sk@dolby.com
Suzanne S. Barnhill - 09 Dec 2004 23:04 GMT
FWIW, a much more efficient way to do this would be to define a character
style that is red and italic. Apply the style to apply the formatting. To
remove it, use Ctrl+Spacebar to ResetChar.

Signature

Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> I have a very simple macro assigned to a button that takes highlighted text
> and makes italic and red .
[quoted text clipped - 18 lines]
> Steve Krause
> sk@dolby.com
 
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.