Please help with importing text

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I want to import text from MS Word. All the files that I
need are in one folder. Instead of importing one file at a
time(there are big number of files), I would like to have
a routin that would loop through the folder and import all
the files. All the files are formated the same way for
that purpose.Any ideas? any Help will be greatly
appreciated.
thanks
Al
 
We had quite a few posts regarding this issue starting on
Jan 26 under a few topics by Jason and Toby. To get you
started, I think the best starting point would be the
sample VB code outline posted by John Nurick as a
response to one of those, which was the following (you
may want to look up help on the Dir() function, which is
really the key to the code):

strFN = Dir("C:\Folder\*.txt")
Do While Len(strFN) > 0
'import this file to Access table
DoCmd.TransferText blah blah blah
'rename this file so we don't use it again by
accident
Name strFN As strFN & ".done"
'get next filename
strFN = Dir()
Loop

-Ted
 
Al: Are the imported files to go to one Access table or a
different table for each Word file? In the simplest case,
each Word file goes into a memo field of the same table.
Are you sure you want to import or would you be satisfied
with an OLE link to your Word file from say the memo
field of the Access table? There are several ways to go
about resolving this but you need to define the problem
better.

GRayL
 
they are all going into one table. The client is trying
to move from different software (professional write, MS
Word...) to Access. However, your idea of linking to word
is interesting. could you give me some details:) thank you
Al
 
Al: Create a table in Access with a hyperlink field. You
may want to add a text field or two for identifying, etc.
Open the table and right click on the hyperlink, select
hyperlink, edit hyperlink, browse for: File, and select
the path and filename for your Word document. From now
on, clicking on that hyperlink in that record will call
up that Word document in Word. I don't know if that is
what you need but it allows you to keep the original Word
files and use Access to "manage" the data using OLE. Any
changes done to the Word files using Word or Access will
be seen when the hyperlink to that file is activated in
Access.

GRayL
 
Back
Top