Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Location
    Naperville, Illinois, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parsing a Word File

    I have an application where I receive reports from outside parties in Microsoft Word format. I want to automate extracting some info into an Access record (these are all Office97). For instance the Word document would have a section labeled "New Products" and then it would have a consistent format:

    Product Item Code - Name / Description.

    The description could be several paragraphs. The number of new products would vary with each file.

    My thought is to cut and paste the entire New Products section into a single Access memo field. Then I would somehow go through the field in a procedure and look for certain words. For example, when the program saw the product item formatted code (always in the format ##-##) it would know to start capturing (appending) the following text etc. until I got to the next product item code. At that point I should have two fields, one with the product code and the other with the description. I would add them to a table in my database as text and memo fields.

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parsing a Word File

    If you have any control over the format of the Word document, and can have the data entered into Word tables, that would simplify the import process. Although I haven't done this myself, <A target="_blank" HREF=http://www.helenfeddema.com/CodeSamples.htm>Helen Feddema</A>has a code sample to illustrate the process.

  3. #3
    Star Lounger
    Join Date
    Apr 2001
    Location
    Naperville, Illinois, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parsing a Word File

    Thanks for responding. I also have corresponded with Helen. Unfortunately I don't have any control over the original documents but I think I have found a way to go through the each using the InStr function. The originators are consistently using the same heading lines for each group within the section with the sections repeating with new info. I search for each heading line and then extract using the MID function. AS long as they remain consistent, I should be okay.

  4. #4
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parsing a Word File

    Consistency is definitely the key to your success or failure. I would suggest you check accuracy prior to adopting the import. I'd probably import to a temp table and either scan it visually or step through the records using a form prior to permanently appending them to an active table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •