Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Montreal, Quebec, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding a line in a footer (office 2000)

    Hello,
    I want to add a graphic line to my footer. I have defined the range. In a normal paragraph I use:

    Set T1Line = ActiveDocument.Shapes.AddLine(96#, 256.5, 554.25, 256.5, T1Range)

    I don't know what to use in a footer. Please help. Tks

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: adding a line in a footer (office 2000)

    Each Header and Footer is a Range, so if you can insert Shapes to any Range you like, it should work in the footer. We recently had a thread on inserting a field code into a footer, perhaps that code will get you started with adding a shape.

  3. #3
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Montreal, Quebec, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding a line in a footer (office 2000)

    Tks. That was me yesterday. I managed to put a field into the footer now I want a graphic line. Can't seem to find the right code for it.
    Set Line = activedocument.shapes.addline won't work because I am in a range and
    Set Line = .range.shapes.addline won't work either. My VBA knowledge is very limited. Could you help please.
    tks.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: adding a line in a footer (office 2000)

    Sorry, I don't understand Shapes and Ranges well enough to work this out. I get the same error as you, and recording a macro uses the Selection object, which you seem to be trying to avoid. I don't suppose you could get by with a top border on that paragraph, instead of a line? Much easier. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  5. #5
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Montreal, Quebec, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding a line in a footer (office 2000)

    Yep, I thought of the paragraph border in the style but this template will end up on a Mac that uses Word 98 and there is a very limited choice of color for paragraph borders in Word 98. I think I will just let it go for now and when they upgrade the software I will put a paragraph border with the right color.

    tks alot.

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: adding a line in a footer (office 2000)

    Here's a working example for you to start from...

    <code>
    Dim shpLine As Shape

    With ActiveDocument.Sections(1).Footers(wdHeaderFooterP rimary)
    .Range.Fields.Add Range:=.Range, Type:=wdFieldPage
    .Range.InsertBefore ("Page ")
    Set shpLine = .Shapes.AddLine(BeginX:=1, BeginY:=1, EndX:=100, EndY:=1, Anchor:=.Range)
    End With
    </code>


    StuartR

  7. #7
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Montreal, Quebec, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding a line in a footer (office 2000)

    This worked just fine. Tks alot.
    jc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •