View Single Post
 
Old 01-28-2022, 02:35 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
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