![]() |
|
#5
|
||||
|
||||
|
Please Help me with this.
Having incomplete knowledge of process is creating huge problem and waste of time. Code:
Sub BrokenImg()
Application.ScreenUpdating = False
Dim StrTxt As String, HttpReq As Object, i As Long
Set HttpReq = CreateObject("Microsoft.XMLHTTP")
Set rng1 = ActiveDocument.Range
With rng1
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^g"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = False
.Execute
End With
Do While .Find.Found
Set rng2 = ActiveDocument.Range(rng1.End, ActiveDocument.Range.End)
If .Hyperlinks.Count > 0 Then
s = .Hyperlinks(1).Address
MsgBox s
If InStr(s, "about") = 1 Then
s = Replace(.Hyperlinks(1).Address, "about", "https")
MsgBox s
rng2.InlineShapes.AddPicture FileName:= _
s _
, LinkToFile:=False, SaveWithDocument:=True
End If
End If
End With
Set rng2 = Nothing
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Set rng1 = Nothing
End Sub
Document is at: https://sites.google.com/site/rtsk2015/fo https://sites.google.com/site/rtsk20...edirects=0&d=1 |
| Tags |
| word vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Missing or damaged XLLEX.DLL
|
Mikets | Office | 1 | 01-02-2014 11:49 PM |
| Searhc for Hyperlinked Word and replace with plain text or nothing | somniloquist | Word | 3 | 10-04-2011 02:33 AM |
| Why isn't my hyperlinked word text hyperlinked when I convert it to pdf? | Obisco | Word | 0 | 12-10-2010 01:58 PM |
| copy-pasting hyperlinked images: work only at the edges | Xuanzang | PowerPoint | 0 | 12-07-2010 02:35 AM |
how find and replace images
|
pol2005 | Word | 2 | 06-10-2010 10:24 AM |