Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2020, 06:17 PM
pkek pkek is offline Typing a highlighted word Windows 10 Typing a highlighted word Office 2019
Novice
Typing a highlighted word
 
Join Date: Mar 2020
Posts: 2
pkek is on a distinguished road
Default Typing a highlighted word

I know this is probably the most basic thing to do for the programming savvy people but I need a macro to type the word " (source)" with a highlight formatting



thanks
Reply With Quote
  #2  
Old 03-21-2020, 09:14 PM
gmayor's Avatar
gmayor gmayor is offline Typing a highlighted word Windows 10 Typing a highlighted word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 3,154
gmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of light
Default

Code:
With Selection
        .Text = " (source)"
        .Range.HighlightColorIndex = wdYellow
        .Collapse 0
        .Range.HighlightColorIndex = wdAuto
  End With
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-21-2020, 09:48 PM
pkek pkek is offline Typing a highlighted word Windows 10 Typing a highlighted word Office 2019
Novice
Typing a highlighted word
 
Join Date: Mar 2020
Posts: 2
pkek is on a distinguished road
Default

thanks, but is there another way when I press undo (ctrl+z) it undoes it all at once?
I tried the script but it seems that I have to press undo 2-3 times before i can delete it completely


to be specific I want it to act like im pasting (ctrl+v) the word " (source)" with highlight without copying every time I start a new session
Reply With Quote
  #4  
Old 03-22-2020, 05:02 AM
gmayor's Avatar
gmayor gmayor is offline Typing a highlighted word Windows 10 Typing a highlighted word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 3,154
gmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of lightgmayor is a glorious beacon of light
Default

You could be create an autotext entry with the text preformatted and insert that. Then insertion would be one action only.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typing a highlighted word Macro in Word to track colour of highlighted text BABZ Word VBA 1 01-09-2017 10:33 PM
Word 2013: scrollbar & highlighted text too pale to see well mascott3 Word 0 10-22-2014 12:55 AM
Typing a highlighted word how keep word document highlighted when switching focus to another application? dylansmith Word 4 05-08-2013 01:21 AM
Word 2003 menu unusable until text is highlighted goude Word 3 05-30-2012 03:36 PM
Typing a highlighted word Word typing problem zacknember Word 2 06-10-2009 11:53 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 04:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft