Solved

How Do I Delete all Frames from Footers in Microsoft Word

Posted on 2009-04-09
2
411 Views
Last Modified: 2012-05-06
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
Comment
Question by:jstlawyers
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 200 total points
ID: 24108152
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
 

Author Closing Comment

by:jstlawyers
ID: 31568527
Many thanks Graham,

This is exactly what i needed.

Appologies for not replying sooner,

John,
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now