#1
|
|||
|
|||
wdHeaderFooterFirstPage
Hi Everyone,
I'm just having a little error with some code. I'm wanted a header & footer to insert on the first page only. When my code is written as the following it works fine, but inserts onto all pages of the document. Code:
Set headerPic = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.AddPicture(SrcePath) Code:
Set headerPic = ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range.InlineShapes.AddPicture(SrcePath) |
#2
|
||||
|
||||
Is the page setup of Section 1 set to show the different first page?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Hi @Guessed,
Whenever I do that in my code, it runs but nothing happens. If I manually change it to have a different first page, it will remove it from the first page and leave it on the rest of the document. Something so simple is proving quite difficult for me! |
#4
|
||||
|
||||
Sarah
Your code is making some assumptions which might be why you don't see the result. Making a change in the first page header of Section 1 assumes that Section 1 is configured to show the first page. There may also be confusion if there is a continuous section break on the first page. In earlier versions of Word, I have wrestled with the placement of floating shapes in headers since VBA treats them as all being in the first section. That code issue shouldn't apply because you are placing the graphic inline but it might be something to look for.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Thread Tools | |
Display Modes | |
|