Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-12-2018, 07:01 PM
AntiqueWhale AntiqueWhale is offline Add, Resize & Relocate Header & Footer with Macros Windows 10 Add, Resize & Relocate Header & Footer with Macros Office 2016
Novice
 
Join Date: Nov 2018
Posts: 11
AntiqueWhale is on a distinguished road
Default

Hi Sarah, First of all, you do not use the statement 2 times.
And it should be Headers, not Header.
And no space between wdHeaderFooterPrimary
And if you wanna use "headerPic", do not Dim "header_pic"....

the code below should work
Code:
Sub AddImageToHeader()
    Dim SrcePath As String, headerPic As InlineShape
    
    SrcePath = "S:\DocBase\Document Templates\Macros\New Macros Nov 2018\Letterhead.jpg"
    
    Set headerPic = ThisDocument.Sections.Item(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(SrcePath)
    
    With headerPic
        .Width = 5.11
        .Height = 20.96
    End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Header and Footer Diablodvs7 Word 1 07-28-2015 07:54 PM
Header and footer aligned in the footer area ashiqghfr Word 2 07-23-2015 01:14 AM
Add, Resize & Relocate Header & Footer with Macros header footer Pierre-Hugues Word VBA 1 08-30-2013 06:06 AM
How to resize the image in the header so that it fits the page Isadora Excel 1 08-20-2013 06:02 AM
Relocate footnotes to facing page Wydeye Word 0 02-23-2010 05:48 PM

Other Forums: Access Forums

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