J
je7383
Good Afternoon!
I'm trying to create a script in Word 2003 that would remove all of the
frames in a document while retaining the text and formatting.
The following creates a new document, cycles through all the frame objects
in the original document, and is supposed to copy the text and formatting
from each frame to the new document.
It almost works! it works on most of the frames in the document, but some
entire frames are copied instead of just the text. Here's what it looks like:
Sub DelFrames()
Dim FrameCounter As Integer
Documents.Add
Documents(2).Activate
For FrameCounter = 1 To ActiveDocument.Frames.Count
'ActiveDocument.Frames(FrameCounter).Select
ActiveDocument.Frames(FrameCounter).Range.Select
Selection.Copy
Documents(1).Activate
Selection.Paste
Documents(2).Activate
ActiveDocument.Frames(FrameCounter).Select
Selection.CopyFormat
Documents(1).Activate
Selection.PasteFormat
ActiveDocument.Paragraphs.Add
Selection.Next(Unit:=wdParagraph, Count:=1).Select
Documents(2).Activate
Next FrameCounter
End Sub
Is there an easier way to convert all of the frames in a document to text
either programmatically, or with a simple keystroke?
Any suggestions will be greatly appreciated.
Thanks
I'm trying to create a script in Word 2003 that would remove all of the
frames in a document while retaining the text and formatting.
The following creates a new document, cycles through all the frame objects
in the original document, and is supposed to copy the text and formatting
from each frame to the new document.
It almost works! it works on most of the frames in the document, but some
entire frames are copied instead of just the text. Here's what it looks like:
Sub DelFrames()
Dim FrameCounter As Integer
Documents.Add
Documents(2).Activate
For FrameCounter = 1 To ActiveDocument.Frames.Count
'ActiveDocument.Frames(FrameCounter).Select
ActiveDocument.Frames(FrameCounter).Range.Select
Selection.Copy
Documents(1).Activate
Selection.Paste
Documents(2).Activate
ActiveDocument.Frames(FrameCounter).Select
Selection.CopyFormat
Documents(1).Activate
Selection.PasteFormat
ActiveDocument.Paragraphs.Add
Selection.Next(Unit:=wdParagraph, Count:=1).Select
Documents(2).Activate
Next FrameCounter
End Sub
Is there an easier way to convert all of the frames in a document to text
either programmatically, or with a simple keystroke?
Any suggestions will be greatly appreciated.
Thanks