1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

MS Word Footer Macro Different Front Page

Discussion in 'Business Applications' started by jm7sa, Oct 7, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. jm7sa

    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

     
  2. md2lgyk

    md2lgyk

    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.
     
  3. jm7sa

    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.
     
  4. md2lgyk

    md2lgyk

    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.
     
  5. jm7sa

    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?
     
  6. md2lgyk

    md2lgyk

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

    jm7sa Thread Starter

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

    If anyone else has any ideas I'd be really gratefull
     
  8. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/756880

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice