I am ugrading to Office 2007, from 2000. This line of code used to work. It
would put my letterhead image in the First Page Header. In Work 2007, it
goes into the regular header, instead of the First page header.
Set oNewLetterHead =
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture(FileName:=Options.DefaultFilePath(Path:=wdUserTemplatesPath)
& "\LetterHead-pg1.wmf", LinkToFile:=True, SaveWithDocument:=True)
The problem seems to be with the "Headers(wdHeaderFooterFirstPage)" section,
but I don't know what else to try. According to all of the documentation,
this should be putting the picture (shape) in the first page header.
Any help would be great.
Thanks
Bret
Doug Robbins - Word MVP - 14 Feb 2008 01:51 GMT
Other people seem to have had the reverse problem - wanting it in the
Primary Header and it ending up in the First Page Header and it seems to be
caused by the image being inserted as an InlineShape.
A couple of fellow MVP's collaborated on the following code as a workaround:
Sub ConvertInlineShapeToShape()
Dim rngShape As Range
Dim rngNewShape As Range
Dim oInlineShape As InlineShape
Dim oShape As Shape
With ActiveDocument.Sections.First
'get the inlineshape from the primary header
Set oInlineShape = _
.Headers(wdHeaderFooterPrimary).Range.InlineShapes(1)
'Temporarily move the inline shape to the first page header
Set rngShape = _
.Headers(wdHeaderFooterFirstPage).Range
rngShape.Collapse
rngShape.FormattedText = oInlineShape.Range.FormattedText
'delete the inline shape from the primary header
oInlineShape.Delete
'convert the moved inline shape to a shape
Set oInlineShape = _
.Headers(wdHeaderFooterFirstPage).Range.InlineShapes(1)
Set oShape = _
oInlineShape.ConvertToShape()
'Copy the converted shape back to the primary header
Set rngShape = _
oShape.Anchor
Set rngNewShape = _
.Headers(wdHeaderFooterPrimary).Range
rngNewShape.Collapse
rngNewShape.FormattedText = rngShape.FormattedText
'delete the temporary shape from the first page header
oShape.Delete
End With
End Sub
Maybe however you can just change your code to put it in the PrimaryHeader
instead of the FirstPageHeader and you may then get it where you want it.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I am ugrading to Office 2007, from 2000. This line of code used to work.
>It
[quoted text clipped - 14 lines]
> Thanks
> Bret