Group: microsoft.public.word.vba.general
From: "Doug Robbins - Word MVP"
Date: Friday, March 28, 2008 4:15 AM
Subject: Re: Logo in Header of all pages

Your code is just adding a picture to the FirstPage header area.

I would repeat my suggestion that you manually set up the headers in the
template and then use code to delete content from them when it is not
required.

--
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

"JN" wrote in message
news:6BC052C4-C134-433E-9543-34714271383D@microsoft.com...
> Hi Jean-Guy,
>
> Thank you for your reply. Your right about the first line so I changed it
> from true to false. IN word 2007 the logo is inserted on all pages but in
> 2003 the logo is not inserted anymore.
>
> I also tried this code:
>
> Sub logoIneerstePagina()
> With ActiveDocument
> .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture
> "C:\kanweg\logo copy.gif"
> With .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1)
> .Height = CentimetersToPoints(3#)
> .Width = CentimetersToPoints(6)
> .Left = CentimetersToPoints(10)
> .Top = CentimetersToPoints(0#)
> End With
> End With
> End Sub
>
> In Word 2007 the logo is inserted on all pages but in Word 2003 on just
> one
> page.
>
> All you other questions the answer is no.
>
> So my problem is that for 2007 the code seems to be ok but I need it also
> to
> run in 2003. Maybe you want to take a look again?
>
> Thank you.
> Regards
> Jan
>
> "Jean-Guy Marcil" wrote:
>
>> "JN" wrote:
>>
>> > Hi,
>> >
>> > For printing on paper witch already has the company logo and for
>> > e-mailing I
>> > use this macro which is triggered manualy.
>> > It places the logo in the header of the first page but I would like the
>> > logo
>> > to be added to the header of all pages. I use Word 2003.
>> >
>> > Sub logoIneerstePagina()
>> >
>> > With ActiveDocument
>> > .PageSetup.DifferentFirstPageHeaderFooter = True
>> > .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture
>> > "C:\kanweg\logo copy.gif"
>> > With .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1)
>> > .Height = CentimetersToPoints(3#)
>> > .Width = CentimetersToPoints(6)
>> > .Left = CentimetersToPoints(10)
>> > .Top = CentimetersToPoints(1#)
>> > End With
>> > End With
>> > End Sub
>> >
>> > Help would be very appreciated.
>> > Thanks
>>
>> Might be easier said than done, depending on the document types you want
>> this code to run on...
>>
>> First of all, your code creates the logo on the first page only on
>> ppurpose
>> because of the lines:
>> .PageSetup.DifferentFirstPageHeaderFooter = True
>> .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes.AddPicture
>> "C:\kanweg\logo copy.gif"
>> Why is your code making sure that the fst page is different if ythis is
>> not
>> what oyu want?
>>
>> Shouldn't it be more like:
>> .PageSetup.DifferentFirstPageHeaderFooter = False
>> .Sections(1).Headers(wdHeaderFooterPrimary).Shapes.AddPicture
>> "C:\kanweg\logo copy.gif"
>>
>> ???
>>
>> But the most important point is this:
>> Will some of the documents have more than one section already in place
>> when
>> the code runs?
>> If not, nevermind, your code is fine.
>> If so, will some of these sections have their header not linked to the
>> previous header?
>> If not, nevermind, your code is fine.
>> If so, you will need code to address this point, this is where it gets a
>> wee
>> bit more complicated...