Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-18-2014, 11:25 AM
gmaxey gmaxey is offline Replace Header Picture Windows 7 32bit Replace Header Picture Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace Header Picture Replace or apply new header in multiple files Carchee Word VBA 42 07-10-2024 08:47 AM
Replace Header Picture Find & Replace in Header/Footer in 1000 files amodiammmuneerk@glenmarkp Word 12 03-05-2018 03:31 AM
Replace Header Picture Watermark Picture in Header AK726 Excel 2 09-17-2014 12:26 PM
Replace Header Picture Find & Replace in Header/Footer PReinie Word 6 01-22-2014 06:45 PM
Replace Header Picture Set Picture Size on Header with VBA stubdba Word VBA 1 03-01-2013 05:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:16 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