Removing Frames In Word 2003

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
 
A

Ada Pan [MSFT]

Hello Jeff,

From the post log, it seems that you need assistance on development. For
development related issues, we recommend you submit your post in MSDN
newsgroups, as they are best suitable to help you with this dev-related
issue. You can go to "Office Solutions Development ->Word
->word.vba.general" on the following web page to reach the newsgroup.

http://msdn.microsoft.com/newsgroups/default.asp

Hope this helps.

Regards,

Ada Pan

Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top