Automated import?

polgara

Registered User.
Local time
Today, 05:53
Joined
Feb 22, 2001
Messages
11
Hi

As I've previously posted in the Word forum - I've got a sectioned document (Word 2000) which I need to import into Access 2000. I've run a macro to separate each section into files and now I need to import specific files into specific fields in my table.

Each file has been named as follows:

test_1
test_2
test_3 etc

test being the original document name

I need to automatically pick say the filename_1, filename_3 files for importing - can anyone advise?
 
You don't say how you intend to import the information or the context of how you intend to use it, store it, etc.

Therefore I'm going to give you a fairly generic answer that might at least give you some ideas about Help Files to read.

Case 1. The whole document is going to be imported as an OLE object.

You need to have something that triggers a filesearch (see help on FILESEARCH object). If a file matches the search, create a record with that file as an OLE object.

Case 2. You want to import the text of the entire document or you want to select some text from the entire document.

You have to open the Word file via automation. What you do is create an Application Object (q.v. in Help) for the Word application.

Once you have the object open, you can open a document in that object by file name. See earlier comments about FILESEARCH.

Now, once the document is open and is the Active Document (see Word Help Topics regarding Word Visual Basic for Applications, look up Active Document), you have the ability to see the collections of things inside that document. To the good, you can see things with the Words, Sentences, Paragraphs, Tables, and several other collections. Except for Words (which is atomic), the other collections frequently contain sub-collections. For example, Paragraphs contains collections of sentences and words. Tables contains collections of rows and cells (or columns and cells - goes both ways...). You can then use VBA to extract selected items.
 

Users who are viewing this thread

Back
Top Bottom