View Single Post
 
Old 11-12-2018, 07:01 PM
AntiqueWhale AntiqueWhale is offline Windows 10 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