Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2022, 02:45 PM
Retko Retko is offline Macro to make a LINE BOLD under cursor Windows 8 Macro to make a LINE BOLD under cursor Office 2013
Novice
Macro to make a LINE BOLD under cursor
 
Join Date: Aug 2014
Posts: 12
Retko is on a distinguished road
Default Macro to make a LINE BOLD under cursor


Hi guys,

can you help me with this macro - I want to make a line bold under my cursor (so I can map it to key and to a mouse key - will be doing lots of bolding)

Thank you.
Reply With Quote
  #2  
Old 01-27-2022, 09:57 PM
gmayor's Avatar
gmayor gmayor is offline Macro to make a LINE BOLD under cursor Windows 10 Macro to make a LINE BOLD under cursor Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What do you mean by a 'line' in this context?
__________________
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 01-28-2022, 12:52 AM
Retko Retko is offline Macro to make a LINE BOLD under cursor Windows 8 Macro to make a LINE BOLD under cursor Office 2013
Novice
Macro to make a LINE BOLD under cursor
 
Join Date: Aug 2014
Posts: 12
Retko is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
What do you mean by a 'line' in this context?
Image

Reply With Quote
  #4  
Old 01-28-2022, 02:35 AM
gmayor's Avatar
gmayor gmayor is offline Macro to make a LINE BOLD under cursor Windows 10 Macro to make a LINE BOLD under cursor Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Unfortunately that doesn't help. There are no 'lines' as such in a Word document. Word formats text by flowing it between the current margins.

Your illustration shows text that terminates with a comma, which suggests that it may not be a complete paragraph.

If it is a complete paragraph, the task is simple
Code:
Sub Macro1()
Selection.Paragraphs(1).Range.Font.Bold = True
End Sub
If the text is only the displayed line within a paragraph, then you should bear in mind that if you change the font attributes, you potentially change the flow between the margins, so the bold 'line' could spill to the next 'line'. However
Code:
Sub Macro2()
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = True
End Sub
could work for you.
In both cases put the cursor in the 'line' and run the macro.
__________________
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
  #5  
Old 01-28-2022, 03:38 AM
Retko Retko is offline Macro to make a LINE BOLD under cursor Windows 8 Macro to make a LINE BOLD under cursor Office 2013
Novice
Macro to make a LINE BOLD under cursor
 
Join Date: Aug 2014
Posts: 12
Retko is on a distinguished road
Smile

The second one works like a charm. Thank you
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autotext entry is taking the cursor to next line/new line skhan Word 10 01-31-2019 06:37 PM
Table: make the bottom line not bold or less thick village Word Tables 2 08-22-2017 06:04 AM
Macro to make a LINE BOLD under cursor Using IF to make bold bigukfan Mail Merge 2 03-07-2014 01:54 AM
Format Bold in one line makes all lines bold Nitte Word 2 02-07-2013 12:34 AM
Macro to make a LINE BOLD under cursor Autocorrect to make words Bold? GB89 Word 1 04-15-2010 09:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:05 PM.


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