View Single Post
 
Old 10-20-2019, 11:14 PM
Ludo_Soete Ludo_Soete is offline Windows 7 64bit Office 2010
Novice
 
Join Date: Oct 2019
Posts: 2
Ludo_Soete is on a distinguished road
Angry Underline word(s) over the whole page width using VBA

Hi,

If i type a word, or words, followed by a CR LF, followed by 3 consecutive underline characters, then is the result a full line under the typed word(s) stretching from the left side of the page to the right side of the page - see picture on the bottom of the message.
This is not the same as underlining the word(s), the line spacing is also different as you can see in the picture.

I would like to obtain this using VBA, but I'm not lucky at all.
I record a macro, see code below, but this is only placing the 3 underline characters on a new line, not what I expected.

How can this be done?
I'm new with Word & VBA for Word, no experience at all.

Ludo

Code:
Sub Macro8()
'
' Macro8 Macro
'
'
    Selection.TypeText Text:="titel"
    Selection.TypeParagraph
    Selection.TypeText Text:="___"
    Selection.TypeParagraph
End Sub
Attached Images
File Type: png Word Title Underline.png (3.5 KB, 17 views)
Reply With Quote