![]() |
#1
|
||||
|
||||
![]()
As part of long process, I want to find following string:
Code:
EP [0-9]{5,} [0-9A-Z]{1,2} if in doc, there is EP 2614045 B1 with hyperlink https://data.epo.org/publication-ser...45&ki=B1&lg=en Code:
Sub EPHYPERLINKDOWN() Dim myURL As String, s As String, s1 As String, StrTxt As String myURL = "https://data.epo.org/publication-server/document?cc=EP&pn=2614045&ki=B1&lg=en" Dim HttpReq As Object, oStrm As Object Set HttpReq = CreateObject("Microsoft.XMLHTTP") HttpReq.Open "GET", myURL, False HttpReq.send s = HttpReq.responseText Set HttpReq = Nothing Set DocNew = Documents.Add With DocNew .Range.Text = s With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindContinue .Format = False .MatchWildcards = True .Text = "https://data.epo.org/publication-server/pdf-document*.pdf*.pdf" .Replacement.Text = "" .Execute End With s1 = Replace(.Text, "amp;", "") End With .Close Set DocNew = Nothing Application.ScreenUpdating = True MsgBox (s1) End With End Sub So, I learned middle part but don't know how to run first part and last one. |
Tags |
word vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple Hyperlink to a single string | PRA007 | Word VBA | 7 | 11-09-2015 04:29 PM |
![]() |
MaineLady | Excel | 2 | 11-05-2015 03:23 PM |
![]() |
TechEd | Word VBA | 5 | 07-05-2014 08:12 PM |
![]() |
errtu | Word | 1 | 01-31-2013 02:09 PM |
![]() |
paulkaye | Word | 4 | 12-06-2011 11:05 PM |