Solved

How Do I Delete all Frames from Footers in Microsoft Word

Posted on 2009-04-09
2
420 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

707 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