4 Fast Methods to Remove Undesired Frames in Your Word Document

In this post, we are going to show 4 fast ways for you to remove undesired frames in your Word document.

To some degree, frames are very must the same like text boxes, both used to holding texts in a document. But frames have some advantages over text boxes. For example, it can contain some fields and you can start footnotes or endnotes inside, either of which works in text boxes.   Remove Undesired Frames in Your Word Document

Despite this, we can’t ignore the need to remove frames you just don’t want anymore. Therefore, we offer you 4 easy but quick ways as below:

Method 1: Remove Frames Manually

  1. Firstly, right click on a frame border.
  2. Then choose “Format Frame” on the contextual menu.
  3. Next in the “Frame” box open, click the “Remove Frame” tab.Right Click on a Frame->Choose "Format Frame"->Click "Remove Frame"

Method 2: Remove All Frames in a Selection

As you see, it’s tedious to remove multiple frames one by one with steps in method 1. To save your time, a quicker approach would be to use the VBA codes.

  1. First of all, make a selection over a range of texts containing frames.
  2. Secondly, press “Alt+ F11” to open VBA editor.
  3. Next click “Normal” project and then click “Insert”.
  4. On the drop-down menu, select “Module”.Click "Normal"->Click "Insert"->Click "Module"
  5. Open the module by double click and paste following codes there:
Sub RemoveAllFramesInSelection()
  Dim objFrame As frame
  Dim nFrame As Long
 
  Application.ScreenUpdating = False
 
  nFrame = Selection.Frames.Count
 
  For Each objFrame In Selection.Frames
    objFrame.Delete
  Next objFrame
  MsgBox ("All " & nFrame & " frames in this selection have been removed!")
 
  Application.ScreenUpdating = True
End Sub
  1. Finally, click “Run” button or hit “F5” to execute codes.Paste Codes->Click "Run"

You will receive a message box, indicating you the result, such as below:Message Box Showing the Result

Method 3: Remove All Frames in Current Document

Still, we will need a macro to do the batch processing.

  1. Install and run a macro with steps in method 2.
  2. Then replace that macro with this one:
Sub RemoveAllFramesInDoc()
  Dim objFrame As frame
  Dim nFrame As Long
 
  Application.ScreenUpdating = False
 
  nFrame = ActiveDocument.Frames.Count
 
  For Each objFrame In ActiveDocument.Frames
    objFrame.Delete
  Next objFrame
  MsgBox ("All " & nFrame & " frames in this document have been removed!")
 
  Application.ScreenUpdating = True
End Sub

Similarly, you will be notified with a message box once the process is over.

Method 4: Remove All Frames in Multiple Documents from a Folder

In case you have a batch of documents all including frames, we also provide a macro to do the task.

  1. Paste and run these codes in VBA module:
Sub RemoveAllFramesInAllDocsInFolder()
  Dim objDoc As Document
  Dim dlgFile As FileDialog
  Dim nFile As Integer
  Dim objFrame As frame
  Dim nFrame As Long
 
  Set dlgFile = Application.FileDialog(msoFileDialogFilePicker)
 
  With dlgFile
    dlgFile.AllowMultiSelect = True
    If .Show = -1 Then
      For nFile = 1 To dlgFile.SelectedItems.Count
        Documents.Open dlgFile.SelectedItems(nFile)
        Set objDoc = ActiveDocument
 
        nFrame = ActiveDocument.Frames.Count
        For Each objFrame In ActiveDocument.Frames
          objFrame.Delete
        Next objFrame
        objDoc.Save
        objDoc.Close
      Next nFile
    Else
      MsgBox "No file is selected! Please select a target file."
      Exit Sub
    End If
  End With
End Sub
  1. Now you will trigger the “Browse” window. Select target documents and click “Open”. Then in seconds, you will have all frames in selected documents removed.

Overcome Data Disaster

Needless to say, data disaster is by no means horrible. It can even be a career threat to some extent. So to safeguard data and know the right action to take after data loss happens is of vital importance. One of the advisable measures is to get hold of a docx fix tool in advance.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xlsx fix and pdf repair software products. For more information visit www.datanumen.com

3 responses to “4 Fast Methods to Remove Undesired Frames in Your Word Document”

  1. Hey! Someone in my Myspace group shared this site with us so I came to take a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to my followers! Fantastic blog and terrific design and style.

  2. sadly this did not work for me with word 365. It did remove the formatting on some of the styles for some reason. I tried both the selection and document based scripts.
    I

Leave a Reply

Your email address will not be published. Required fields are marked *