aziz rasul
01-26-2007, 03:06 AM
Does anyone know, when having selected the filepath of a MS Word file in a textbox, how to copy the contents of the Word file and place into a memo field of a table?
|
View Full Version : Copying data from MS Word file aziz rasul 01-26-2007, 03:06 AM Does anyone know, when having selected the filepath of a MS Word file in a textbox, how to copy the contents of the Word file and place into a memo field of a table? The_Doc_Man 01-26-2007, 10:09 PM Yes. You might not like it. Word can be opened as an application object. Once it has been opened, you can open a file (such as the name in your textbox). The application object's current document then exposes its collections that can be imported or otherwise mucked about. The collections you will see include paragraphs, words, tables, figures (referring to embedded figures), drawings (referring to things drawn in the Word file with the drawing tools), etc. The catch is that unless you are ONLY pulling text from the file, Access will be unable to interpret what it sees from Word. After all, Word is the word processor. Access doesn't do word processing. So unless you strip away all of the formatting information (leaving behind naked text), importing data from Word to Access won't look right when it is done. Moniker 01-28-2007, 11:46 AM The easiest way to make sure you're only getting text is to save your Word file(s) as Text documents. After that, the Word object will be needed and you get that by adding the "Microsoft Word X.0 Object Library", where X is the version number. There are many examples on these forums of accessing an application through the aplication's object. aziz rasul 01-29-2007, 01:17 AM OK. I'll try creating a text file and see what happens. |