View Single Post
 
Old 01-27-2014, 04:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
Dim iShp As InlineShape, strTxt As String, Rng As Range, sWd As Single, sHi As Single
strTxt = "Alternative Text"
With ActiveDocument
  For Each iShp In .InlineShapes
    With iShp
      If .AlternativeText = strTxt Then
        sWd = .Width
        sHi = .Height
        Set Rng = .Range
        .Delete
        Exit For
      End If
    End With
  Next
  Set iShp = .InlineShapes.AddPicture(FileName:="IMAGE_LOCATION", _
    LinktoFile:=False, SaveWithDocument:=True, Range:=Rng)
  With iShp
    .AlternativeText = strTxt
    .Width = sWd
    .Height = sHi
  End With
End With
Set iShp = Nothing: Set Rng = Nothing
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote