Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

PowerPoint underlines spaces and tabs - workaround

Problem

In PowerPoint 97 and previous, when you chose some text and set it to be underlined, each word was underlined but not the spaces between the words.

When you do the same thing in PowerPoint 2000 and up (or open an older file in PowerPoint 2000 and up) the space are underlined as well.

Solution

Select your text and then run this macro. It will remove the existing underlining, then underline each word but not the spaces between words.

Sub ReUnderline()

    Dim x As Long

    With ActiveWindow.Selection.TextRange
        ' turn off underlining overall
        .Font.Underline = msoFalse
        For x = 1 To .Words.Count
            If Right$(.Words(x), 1) = " " Then
                .Words(x).Characters(1, .Words(x).Characters.Count - 1).Font.Underline = msoTrue
            Else
                .Words(x).Font.Underline = msoTrue
            End If
        Next
    End With

End Sub

If you haven't underlined anything yet and just want to underline the words (but not punctuation characters), try this:

Sub UnderlineUs()
    Dim oRng As TextRange
    Dim x As Long

    Set oRng = ActiveWindow.Selection.TextRange
    For x = 1 To oRng.Characters.Count
        Select Case oRng.Characters(x)
            Case Is = " ", ",", ".", "?", "!", vbTab
                ' Don't underline it
                ' Add more characters above as needed
            Case Else
                oRng.Characters(x).Font.Underline = True
        End Select
    Next
End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

PowerPoint underlines spaces and tabs - workaround
http://www.pptfaq.com/FAQ00735_PowerPoint_underlines_spaces_and_tabs_-_workaround.htm
Last update 07 June, 2011
Created: