Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-28-2019, 04:56 AM
gmayor's Avatar
gmayor gmayor is offline Hyphen until the end of the row Windows 10 Hyphen until the end of the row Office 2016
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

Automatically would be a stretch, but you can use a macro to create a tab at the right margin and add a tab with a dashed leader to fill the space. Put the cursor in the 'line' in question and run the macro
Code:
Sub TabToEndOfLine()

Dim lngWidth As Long, lngLM As Long, lngRM As Long
Dim oRng As Range
    
    With Selection.Sections(1).PageSetup
        lngLM = .LeftMargin
        lngRM = .RightMargin
        lngWidth = .PageWidth
    End With

    Set oRng = Selection.Paragraphs(1).Range
    oRng.End = oRng.End - 1
    With oRng.ParagraphFormat.TabStops
        .ClearAll
        .Add Position:=lngWidth - lngLM - lngRM, _
             Alignment:=wdAlignTabRight, _
             Leader:=2
    End With
    oRng.Collapse 0
    oRng.Text = Chr(32) & vbTab
    oRng.End = oRng.Paragraphs(1).Range.End + 1
    oRng.Collapse 0

    oRng.Select
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
__________________
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
 

Tags
hyphen

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyphen goes to next line DBlomgren Publisher 0 07-14-2016 06:46 PM
Bibliography Hyphen for repeat author grantgibson45 Word 3 02-25-2013 04:32 AM
Switching text on either side of hyphen nignog Word 1 01-23-2012 01:13 PM
Hyphen until the end of the row Auto change hyphen to em character not working gstech Word 1 10-08-2010 09:57 AM
Hyphen vs. en-dash tocuin Word 0 09-18-2009 10:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:37 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