Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to globally remove frames from word doc?

Status
Not open for further replies.

gtbikerider

Technical User
May 22, 2001
81
0
0
GB
Hi

I have a word document where all the text is inside hundreds of frames (its been exported from pdf). How can I globally remove all the frames and leave it as 'inline' text? (I need to keep images and formatting)

--
John
 
This may be too simple and arcane, and possibly rather silly, but what about this:

1. Save the file as a text file.
2. Open the original Word Document for the file.
3. Open the new text copy of the file in Notepad or Wordpad or some other text editor.
4. Copy and paste the text from the text document over the text frames in the Word document.

Of course, you'll want a more automated sollution, maybe via VBA code, if you intend to do this frequently.
 
Hi gtbikerider ,

The quickest way would be to use a macro, like:

Sub ClearFrames()
Dim oFrm As Frame
For Each oFrm In ActiveDocument.Frames
oFrm.Delete
Next
End Sub

Cheers

[MS MVP - Word]
 
macropod,

I had the same problem gtbikerider had and used your macro. It removes all of the frames just fine but doesn't seem to retain the formating of the frame on the page.

Is there any way to retain the formatting and location of of the frame on the page in word?

 
Hi jwwillia,

The 'location' information for a frame relates to whatever object/paragraph it's anchored to. I'd expect the contents of the frame to be 'inserted' into the document immediately after that, but I'm away from my own PC this week and next, so I can't test this.

The formatting should be maintained according to whatever styles were in force for the paragraphs within the frame. If, for example, the frame defined an area narrower than the style's margins then the text would be constrained to the frame's borders. Take away those borders, and the page or column margins take over. I suppose one could code around that, defining new styles for the affected text, but that would only go part of the way to dealing with all of the page formatting variables influsenced by frames. For example, it wouldn't restore any text wrapping for body text that previously wrapped around the frame. And I'm not sure could could achieve that by anything simpler than a frame or text box.

Perhaps you should try a different pdf-to-Word conversion application - some may do a better job of retaining formatting with fewer frames than others.

Cheers

[MS MVP - Word]
 
And I'm not sure could could achieve that by anything simpler than a frame or text box.
In other words, compensate for the removal of the frames, by putting in....a frame?

The influence - good choice of words macropod - of the frames is quite deep. The structure and flow of text is directly affected. It would be difficult to retain the exact same look after you remove the frames.

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top