(Batch) Delete Frames in a Word 2007 doc

Microsoft Office 2007 small business wit...
July 21, 2010 at 20:58:31
Specs: Windows XP
When "converting a table to text" in a Word 2007 document, the content is placed into a frame (at least in the documents we process). When double-clicking on the frame, it brings up a window that includes a "Delete frame" button. This button does the job, BUT is there a way to pick and delete all frames in the document while keeping the data as is? (the reason being that our indexing engine freezes when it runs into a frame). Thank you for your help.

See More: (Batch) Delete Frames in a Word 2007 doc

Report •

August 1, 2010 at 09:57:57

Here is a macro that deletes frames from the active document, leaving the frame contents in place.

This macro makes significant changes to a document and I cannot be sure how it will affect different documents. I have only been able to test this on one document containing frames. The word count was the same before and after running the macro.

I strongly suggest that this macro is only used on copies of documents, not originals.

Here is the code:

Sub DltFrames()
Dim n As Integer

With ActiveDocument.Frames
    'loop through each frame starting at the end
    For n = .Count To 1 Step -1
        'Delete frame - contents remain unchanged
    Next n
End With
End Sub


Report •

August 1, 2010 at 16:16:41

Thank you very much for this handy macro.



Report •

Related Solutions

Ask Question