View Single Post
 
Old 10-09-2020, 05:47 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim URL As String
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    Selection.ClearFormatting
    .Text = "http" & "*" & vbCr & "-----"
    .MatchWildcards = True
    .MatchWholeWord = True
    Do While .Execute
      oRng.End = oRng.End - 6
      URL = oRng.Text
      oRng.Collapse wdCollapseEnd
    Loop
  End With
  MsgBox URL
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote