extract data from Frame

  • Thread starter Rekhender Dhawan
  • Start date
R

Rekhender Dhawan

Hi!

I need to create a programe which can extract data from frames in Word
document. But i'm not able to do so. Please give some idea on it.

Regards
Rekhender
 
P

Peter Hewett

Hi

There is a Frames collection, all you need to do is loop through that
collection. Here's how you do that and access the text in the Frame:

Public Sub LoopThroughFrames()
Dim frmItem As Word.Frame

For Each frmItem In ActiveDocument.Frames
MsgBox frmItem.Range.Text
Next
End Sub


HTH + Cheers - Peter
 
R

Rekhender Dhawan

Thanks Peter, but what if I also have pictures in my document. Actually what
i need to do is to create a DOC file from PDF. I' able to do so, but the
document which I get in DOC is all in frames, even each and every character
is coming in separate frame. But my requirement is that it should be a
proper paragraph as such the document is written is word itself, can u
suggest some good tech. to do so..??

thanks in advance
Rekhender
 
P

Peter Hewett

Hi Rekhender

I don't know how much control you have (if any) over the process that's
doing the PDF to Doc conversion. But that's obvious where the problem lies.
Putting every character/picture etc. in it's own frame is going to make the
resultant document unusable - as you've just found out.

You can try this to delete all the Frames, but it's going to make a real
mess of the page layout, plus each frame contains it's own paragraph mark,
so you get whatever's in the frame plus a paragraph mark. Exactly what you
document looks like will probably depend upon the style of Normal.dot and
any direct paragraph/character formatting.

Frankly if the problems as bad as you say (every character etc. in it's own
Fram) I can't see a viable solution. Maybe you can do the PDF > Doc
conversion differently?

Here's some code to remove all the frames, but as per my comments above, I
really don't see it as being particularly useful:

Public Sub Unframe()
Dim frmItem As Word.Frame

For Each frmItem In ActiveDocument.Frames
frmItem.Delete
Next
End Sub


Cheers - Peter
 
R

Rekhender Dhawan

Hi! Peter,
Well i think you're right, we need to think abt this conversion
differently, but the very imp. question is HOW?

see till now i'm using a tool called LEADTOOLS ePrint. This actually
creates a virtual printer on my machine and then i just need to send my pdf
print to this printer. It then asks me for the conversion document type,
which is .DOC and that's it, it converts the doc. to word. But in converting
it , sometimes it converts each charater into a frame or sometimes it even
places one full line in the frame.

So do u have suggestions???

Thanks
Rekhender
 
P

Peter Hewett

Hi Rekhender

I've no experience with Leadtools ePrint. I'd suggest you maybe try RTF,
HTML or possibly XML (which is only usable with Word 2003) output formats
instead if they're supported. I'd also check out what if any configuration
options ePrint offers you. I'd also contact their tech support.

If these options fail I guess it's time to find another conversion tool.

HTH + Cheers - Peter
 
A

Amin Dodin

Hi,
This is Amin Dodin form LEAD tech support.
Peter's suggestion of contacting us is a good idea. We normally reply
within 2 business days.
About the DOC frames, you can turn them off from the printer
properties of ePrint. Go to the 'Save' tab and un-check "Enable Framed
Text". This will give you an easier document to edit, but the tradeoff
is that the document might not look exactly like the original. Try
that and if you still have a problem, send us an email (or a web
request from our site)

Amin
 

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