Forum Discussion
Formatting on word
I am trying to highlight the blank spaces so every line of text and the rest of the page can be underlined. The regular underline function only underlines the words highlighted. Is there anyway to highlight the entire page so when I use the underline function the entire page gets underlined?
4 Replies
- ricardojoseBrass Contributor
- Charles_KenyonBronze Contributor
I can think of no way to simply do this.
You can put a bottom border on a paragraph and make each line a separate paragraph. This really makes a document hard to edit though.
You can put an image or a table positioned behind text that has the lines.
Here is an attempt at it. It uses a Table in a Textbox that is positioned behind text.
Notebook Template - free download
You would want exact line spacing for this to work.
- btodd620Copper ContributorSo there is no ay for me to just highlight an entire page even though the words don't go all the way across the page? If I Can just highlight the entire page I can just use the underline function and it will do the whole thing
- Charles_KenyonBronze Contributor
Word is not built to do this. Period. Here is as close as I can come to what you want.
- Select all the text where you want the underlines.
- Set a Right Tab at the right Margin.
- Underline the text (Ctrl+U).
- Justify the text (Ctrl+J).
- Press the Tab key at the end of each paragraph. This extends the underline to the tab setting.
Here is a screenshot showing formatting characters. I have circled the tabs.
If you need to have the first line of a paragraph indented, you need to do it with a Tab rather than a first-line paragraph indent and must have another tab setting to catch the first tab.
Unless your typing is strange, this is going to change your text layout.
Here is a macro that does this to selected text.
Sub UnderlineAllToMargins() ' ' Charles Kenyon 2023-01-13 ' https://techcommunity.microsoft.com/t5/word/formatting-on-word/m-p/3715875 ' With Selection ' Underline text (character formatting) .Font.Underline = wdUnderlineSingle ' With .ParagraphFormat ' Align for full justification .Alignment = wdAlignParagraphJustify ' ' Add Right Tab Stop .TabStops.Add Position:=InchesToPoints(6.5), _ Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces ' ' adjust to single space .LeftIndent = InchesToPoints(0) .RightIndent = InchesToPoints(0) .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .LineUnitBefore = 0 .LineUnitAfter = 0 End With ' ' Tab at end of each paragraph With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "^p" .Replacement.Text = "^t^p" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting .Replacement.ClearFormatting .Text = "" .Replacement.Text = "" End With End With End Sub
If any of the text has a paragraph indent, the underlining will start at the indent. Likewise, if there is a right indent inside the margin, it will stop there.
The macro single spaces the text and removes any spacing between paragraphs. The lines that do this are indicated and can be removed or commented out if you want something different.
Here is what to do with macros:- Install/Employ VBA Procedures (Macros) by Greg Maxey
- Instructions for Installing Macros from Forums or Websites by Graham Mayor, MVP
You can assign a keyboard shortcut to this macro and/or put it on your QAT.
- Assigning Keyboard Shortcuts in Microsoft Word 2007-2021 (365)
- Modifying the Quick Access Toolbar (QAT) in Microsoft Word