Inserting a logo to the header and ...

L

Leila

I want to insert a logo to the header of a document which
has an inserted number as a footer(by another macro). When
I run the below code the footer gets deleted and the logo
gets inserted to the header. What I want is to keep them
both, any suggestion? Thanks

Sub InsertALogo(

With ActiveDocument.PageSetu
.DifferentFirstPageHeaderFooter = Tru
End Wit

With ActiveDocument.Sections.First.Header
(wdHeaderFooterFirstPage).Rang
.InsertFile FileName:="C:\Logo.doc",
ConfirmConversions:=False,
Range:="",
Link:=False,
Attachment:=Fals
End Wit

End Su
 
D

Doug Robbins - Word MVP

As Charles Kenyon told you, the footer is not being deleted. It is more
than likely that it was in the wdHeaderFooterPrimary and it will still be
there and will appear when the document has more than one page. If you want
it to also appear on the first page. you should add the following line of
code

ActiveDocument.Sections.First.Footers(wdHeaderFooterFirstPage).Range =
ActiveDocument.Sections.First.Footers(wdHeaderFooterPrimary).Range

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
L

Leila

Thanks so much it works great the only thing that happens
now is that the first page footer loses the format that I
set for it, any suggestion?
Leila
-----Original Message-----
As Charles Kenyon told you, the footer is not being deleted. It is more
than likely that it was in the wdHeaderFooterPrimary and it will still be
there and will appear when the document has more than one page. If you want
it to also appear on the first page. you should add the following line of
code

ActiveDocument.Sections.First.Footers
(wdHeaderFooterFirstPage).Range =
 
D

Doug Robbins - Word MVP

Use

ActiveDocument.Sections.First.Footers(wdHeaderFooterFirstPage).Range.Formatt
edText = ActiveDocument.Sections.First.Footers(wdHeaderFooterPrimary).Range


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
L

Leila

Awesome, thanks for your help.
-----Original Message-----
Use

ActiveDocument.Sections.First.Footers (wdHeaderFooterFirstPage).Range.Formatt
edText = ActiveDocument.Sections.First.Footers (wdHeaderFooterPrimary).Range


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top