View Single Post
 
Old 09-18-2014, 11:25 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Run the following as a custom procedure using my Batch Process documents add-in http://gregmaxey.com/word_tip_pages/...der_addin.html:

Code:
Function ChangeLogoPicture(ByRef oDoc As Word.Document) As Boolean
Dim oHeader As HeaderFooter
Dim oRng As Range, oRngTarget As Range
Dim oILS As InlineShape
   On Error GoTo Err_Handler
  'Assumes logo is in First Page Header (modify if required)
  Set oHeader = oDoc.Sections(1).Headers(wdHeaderFooterFirstPage)
  Set oRng = oHeader.Range
  If oRng.InlineShapes.Count > 0 Then
      Set oILS = oRng.InlineShapes(1)
      Set oRngTarget = oILS.Range
      oILS.Delete
      Set oILS = ActiveDocument.InlineShapes.AddPicture(FileName:="C:\New Pic.png", linktofile:=False, Range:=oRngTarget)
      With oILS
        'Do whatever you might need to do.
      End With
    End If
  ChangeLogoPicture = True
lbl_Exit:
  Exit Function
Err_Handler:
  ChangeLogoPicture = False
  Resume lbl_Exit
End Function
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote