Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 12-04-2015, 04:35 AM
PRA007's Avatar
PRA007 PRA007 is offline How to replace damaged hyperlinked images from web. Windows 7 64bit How to replace damaged hyperlinked images from web. Office 2010 32bit
Competent Performer
How to replace damaged hyperlinked images from web.
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

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
In this code, inserting starts at whenever selection is followed by .found. How to start inserting at .found.

Document is at:
https://sites.google.com/site/rtsk2015/fo
https://sites.google.com/site/rtsk20...edirects=0&d=1
Reply With Quote
 

Tags
word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace damaged hyperlinked images from web. 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 to replace damaged hyperlinked images from web. how find and replace images pol2005 Word 2 06-10-2010 10:24 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft