Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-27-2019, 07:15 AM
gmaxey gmaxey is offline prefix all underlined text with a tab Windows 10 prefix all underlined text with a tab Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

or, if there is already a tab immediately preceding the underlined text and you want to avoid duplicates use:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.Underline = wdUnderlineSingle
    While .Execute
      If Not Asc(oRng.Characters.First.Previous) = 9 Then
        oRng.InsertBefore vbTab
        oRng.Collapse wdCollapseEnd
      End If
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find entries lacking prefix and then add prefix. gsteel Excel 2 08-28-2017 11:36 AM
prefix all underlined text with a tab Word - text in red and underlined ghphoto Word 3 02-18-2013 08:39 AM
prefix all underlined text with a tab Create an underlined form field within an already underlined line? lwisniewski Word 1 01-21-2013 05:49 AM
Underlined copied text box LarryStroup PowerPoint 0 09-30-2011 11:22 AM
PP Slide copied text is underlined LarryStroup PowerPoint 0 05-20-2011 11:16 AM

Other Forums: Access Forums

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