• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

How Do I Delete all Frames from Footers in Microsoft Word

Hi,

I need to delete all frames from the footers of documents and replace these with a new one.  I've got the word macro sorted to create the new frame in the footer.  How can i though first delete the frame using a vb macro?
0
jstlawyers
Asked:
jstlawyers
1 Solution
 
GrahamSkanCommented:
This will delete all the frames in all the footers in all the sections.
Sub DelFramesInFooters()
    Dim Sec As Word.Section
    Dim ftr As Word.HeaderFooter
    Dim wrdFrame As Word.Frame
    
 
    For Each Sec In ActiveDocument.Sections
        For Each ftr In Sec.Footers
            For Each wrdFrame In ftr.Range.Frames
                wrdFrame.Delete
            Next wrdFrame
        Next ftr
    Next Sec
End Sub

Open in new window

0
 
jstlawyersAuthor Commented:
Many thanks Graham,

This is exactly what i needed.

Appologies for not replying sooner,

John,
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now