Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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,144
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 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
 



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 12:54 PM.


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