Hi,
I'm trying to convert many urls in this format to hyperlinks:
http://www.example.com
So after conversion they would like that with the URL as the anchor text, nothing fancy.
I have a macro that does this, but deletes the carriage returns before and after the URL. Please the attached pictures before and after the macro has been run. How would I go about fixing the attached code to stop doing this?
Thanks!
Code:
Sub URL2Hyperlink()
Dim f1 As Boolean, f2 As Boolean, f3 As Boolean
Dim f4 As Boolean, f5 As Boolean, f6 As Boolean
Dim f7 As Boolean, f8 As Boolean, f9 As Boolean
Dim f10 As Boolean
With Options
' Save current AutoFormat settings
f1 = .AutoFormatApplyHeadings
f2 = .AutoFormatApplyLists
f3 = .AutoFormatApplyBulletedLists
f4 = .AutoFormatApplyOtherParas
f5 = .AutoFormatReplaceQuotes
f6 = .AutoFormatReplaceSymbols
f7 = .AutoFormatReplaceOrdinals
f8 = .AutoFormatReplaceFractions
f9 = .AutoFormatReplacePlainTextEmphasis
f10 = .AutoFormatReplaceHyperlinks
' Only convert URLs
.AutoFormatApplyHeadings = False
.AutoFormatApplyLists = False
.AutoFormatApplyBulletedLists = False
.AutoFormatApplyOtherParas = False
.AutoFormatReplaceQuotes = False
.AutoFormatReplaceSymbols = False
.AutoFormatReplaceOrdinals = False
.AutoFormatReplaceFractions = False
.AutoFormatReplacePlainTextEmphasis = False
.AutoFormatReplaceHyperlinks = True
' Perform AutoFormat
ActiveDocument.Content.AutoFormat
' Restore original AutoFormat settings
.AutoFormatApplyHeadings = f1
.AutoFormatApplyLists = f2
.AutoFormatApplyBulletedLists = f3
.AutoFormatApplyOtherParas = f4
.AutoFormatReplaceQuotes = f5
.AutoFormatReplaceSymbols = f6
.AutoFormatReplaceOrdinals = f7
.AutoFormatReplaceFractions = f8
.AutoFormatReplacePlainTextEmphasis = f9
.AutoFormatReplaceHyperlinks = f10
End With
End Sub