View Single Post
 
Old 12-03-2015, 02:01 AM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

I don't know why but ActiveDocument.InlineShapes doesn't find InlineShapes for my document.
Anyhow ^g is working.

I tried this code from various earlier suggestions.

Code:
Sub BrokenImages2()
Application.ScreenUpdating = False
Dim StrTxt As String, HttpReq As Object, i As Long
Set HttpReq = CreateObject("Microsoft.XMLHTTP")
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^g"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = False
    .Execute
  End With
  Do While .Find.Found
    If .Hyperlinks.Count > 0 Then
      s = .Hyperlinks(1).Address
    MsgBox s
        If InStr(s, "about") = 1 Then
        s = Replace(.Hyperlinks(1).Address, "about", "HTTP")
        MsgBox s
        With Dialogs(wdDialogInsertPicture)
        .Name = s
        .Execute
        End With
        End If
    End If
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
End Sub
This is inserting images at selection.
How to replace images that found with url images?
Reply With Quote