View Single Post
 
Old 10-11-2013, 12:47 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

You could use code like:
Code:
Sub UpdateFooters()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String, Rng As Range
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
While strFile <> ""
  Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, _
    AddToRecentFiles:=False, Visible:=False)
  With wdDoc
    With .Sections.First.Footers(wdHeaderFooterPrimary)
      If .InlineShapes.Count <> 0 Then
        Set Rng = .InlineShapes(1).Range
        With Rng
          .InlineShapes(1).Delete
          .InlineShapes.AddPicture FileName:="H:\My Documents\VBA\picture.jpg", _
            LinkToFile:=False, SaveWithDocument:=True
        End With
      End If
    End With
    .Close SaveChanges:=False
  End With
  strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
 '
Function GetFolder() As String
    Dim oFolder As Object
    GetFolder = ""
    Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
    If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
    Set oFolder = Nothing
End Function
You may want to add a bit more to control the image size too.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote