PDA

View Full Version : Extract Text from Word Document and Put in TextBox



Keags1
10-24-2012, 01:52 AM
Hi,

I have a series of PDF documents and have managed to add hyperlinks to these documents based upon a selection in a listbox and some comboboxes.

I have set this up in Excel, as per the PM's wishes.

I would like to have a summary for each PDF be shown in a textbox / whatever is best for this, when an item is selected from the listbox.

So far I have managed to find the word document path and name in my script - I plan to use this to call the word document, however I was wondering the best way to copy the text out of the word document and paste it into the textbox in Excel.

Also is it possible to retain formating of the text?

thank you!
K

snb
10-24-2012, 02:04 AM
What is the relation between PDF files and a Word document ?

Keags1
10-24-2012, 02:09 AM
Hi,

The PDF is the full report and the Word Doc will contain a short summary of the PDF.
It is meant to give an overview, as the PDF names can be a bit confusing.

snb
10-24-2012, 02:18 AM
Sub snb()
textbox1.text=getobject("G:\OF\example.doc").content
end sub

Keags1
10-24-2012, 02:41 AM
WOW...

Thank you, that is exactly what I needed, and it was so simple.
thank you!