MS Word Footer Macro Different Front Page

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jm7sa

Thread Starter
Joined
Oct 7, 2008
Messages
4
Hi - I am trying to write a simple macro for MS Word (I'm using 2007 but would like it to work for 2003 too ideally)

The macro should:

  1. insert a website address and company details into the footer of the first page of a document and then
  2. insert a logo into the footer of all subsequent pages.
I'm a bit of a newbie and I've tried to record a macro to do this but it puts everything into the first footer.

I have searched through these forums and come up with a macro that lets me place text into the first page only - but I can't then add the alternative footer for subsequent pages.

Here's my macro (apologies in advance....)


Sub footer()
'
' footer Macro
'
'

ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True
WordBasic.ViewFooterOnly
Selection.Font.Size = 8
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.TypeText Text:= _
"MY WEBSITE ADDRESS AND COMPANY DETAILS"
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveWindow.View.Type = wdPrintView
WordBasic.ViewFooterOnly
Selection.InlineShapes.AddPicture FileName:= _
"C:\images\mylogo.jpg", _
LinkToFile:=False, SaveWithDocument:=True
End If

End Sub

 
Joined
Jul 3, 2003
Messages
1,068
Unless you're just trying your hand at writing a macro, why are you doing this? There's a much easier way in Word already.
 

jm7sa

Thread Starter
Joined
Oct 7, 2008
Messages
4
Thanks for the reply MD2LGYK - I need to find a simple way to import five different logos and websites for the various sub-brands of my company. The solution needs to be rolled out to a team of sales administrators.

I just presumed that using Macros and buttons would be the easiest way to achieve this.

If there is an easier way of doing this I'd be delighted to hear from you.
 
Joined
Jul 3, 2003
Messages
1,068
Are you creating new documents, or do they already exist and you want to modify them? Either way it's not too hard. Starting at the beginning of the document, go to File>Page Setup. Click on the Layout tab. Under Headers and Footers, be sure the Section Start is set to New Page (that's the default) and then click Different First Page. Go back to the document and insert whatever you want into the footers on the first and second pages.

If your document has only one section, you're done. Otherwise, you'll need to go to the start of each section and tinker with the Same as Previous option to get what you want. It's easier if all sections past the first are NOT formatted to Different First page.
 

jm7sa

Thread Starter
Joined
Oct 7, 2008
Messages
4
Thanks for the reply!

I was aware of this function and was trying to record it into a macro: however I wasn't able to.

I appreciate that this isn't a hard thing to teach people to do but the powers that be here have asked for this to be made into a macro for continuity purposes.

Going back to the macro I wrote does it seem to be even close to working or do i need to start again?

All it seems to do is write the web address text on the front page - it then leaves all subsequent footers blank - presumably I'm missing a bit of code somewhere?
 
Joined
Jul 3, 2003
Messages
1,068
I'm sorry, but I don't use macros and don't know anything about them. Someone else will surely chime in here.
 

jm7sa

Thread Starter
Joined
Oct 7, 2008
Messages
4
Thanks for the help!

If anyone else has any ideas I'd be really gratefull
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top