Get data from frames in a document

T

Trefor

I am trying to get the data from a document that is full of frames. When I
run the code below I get what I need, but not in the order I need it. I
didn't create the original document and I presume the frame numbers are not
laid out left to right and from top to bottom so I get this unusual order of
data. How can I ensure the date is read left to right and top to bottom?

Sub getframetest()
Dim Word As New Word.Application
Dim WordDoc As New Word.document
Dim oFrame As Word.Frame
Dim TextVar As String

Word.Visible = True
Set WordDoc = Word.Documents.Open("C:\temp\InstNotRpt.rtf")

For Each oFrame In WordDoc.frames
TextVar = oFrame.Range
Next

Word.Application.Quit
Set Word = Nothing

End Sub
 

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