Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Oct 2007
    Posts
    172
    Thanks
    0
    Thanked 2 Times in 1 Post

    Shapes, Shaperanges (Word 2003 VB)

    Hi,

    I have a document where i am trying to add a logo (a shape) to the footers. I am still having difficulty with the relationship between the sections(i).Footers(j).Shapes collection and the sections(i).Footers(j).range.ShapeRange collection.

    I can only add shapes to the Shapes collection, which contains all shapes in all footers in all sections of the document. How do I then "add" these shapes to the ShapeRanges in the specific footers in the specific sections? So if I add my logo to the Shapes collection, how do I then say "I want that logo now to appear in that section footer"?

    So far I have added three logos in different positions, one into each Shapes collection for each of the three types of footer index (first, primary and evens). The logo appears in the document in the first section in all three footer types as expected, and any subsequent "linked" section footer. However, the logo does not appear in the footers of an inserted section that is NOT linked to the previous. So now I wish to say "use this logo in this unlinked section footer too".

    But I can't seem to control which Shapes are in the ShapeRange collection for that footer.

    Help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shapes, Shaperanges (Word 2003 VB)

    You should be able to add a shape to a specific header or footer like this:

    Dim hdr As HeaderFooter
    Dim shp As Shape
    Set hdr = ActiveDocument.Sections(2).Footers(wdHeaderFooterP rimary)
    Set shp = hdr.Shapes.AddPicture("C:MyLogo.jpg")

Posting Permissions

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