invisible image in header section RRS feed

  • Question

  • Hallo,

    i have a word 2010 template with invisible Images in the Header section and i can't make them visible to delete them.

    Inside the XML-structure of the template are 2 images files in the word/media folder. These files are referenced in the file word/header2.xml.

    How can i make them visible in word, and how can i access these images in vba.  I've tried shapes and inlineshapes collections, but they're empty.

    Tuesday, October 28, 2014 1:10 PM


  • Look at this VBA code and notes. Hopefully it will help you understand what you have to do to access shapes in the header or footer layer of a document.

        Debug.Print ActiveDocument.InlineShapes.count 'only inline shapes in the document body collection are counted
        Debug.Print ActiveDocument.Shapes.count 'only floating shapes in the document body collection are counted
        'to access shapes (inline or floating) in the header layer of the document it must be done by Section and by header/footer type
        Debug.Print ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.count
        Debug.Print ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.count

    Kind Regards, Rich ...

    • Marked as answer by JuergenW Wednesday, October 29, 2014 10:24 AM
    Tuesday, October 28, 2014 2:41 PM