I am trying to use the following to insert a picture into the header of a Word document
The code errors on the last line above with a Run Time error 438 Object doesn't support this property.
I had previously used
but I need to move, change the size, etc of the image that has been inserted so I need to assign it to an object variable somhow.
TIA
VBA Code:
strPath = ActiveWorkbook.Path
'Hold the full path of the picture to be inserted into Word
strClientLogo = Range("FD_ClientLogoPath")
'Word session creation
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
'open the template .doc file
Set docWord = appWord.Documents.Open(strPath & "\Template Client Output.docx")
'Access the header range only need to add to page 2 onwards of the Word doc
Set rngHeader = docWord.Sections(2).Headers(1).Range
'Insert the image into the header
Set picWord = rngHeader.Range.InlineShapes.AddPicture(strClientLogo)
I had previously used
VBA Code:
rngHeader.InlineShapes.AddPicture strClientLogo
TIA