PDA

View Full Version : [SOLVED:] Import MS Word form to Access



sbrown106
02-15-2021, 09:40 AM
Hi there,


First time visiting this site - nice to meet you all!

I'm new to VBA. I've picked up a bit but struggling with this problem I need to solve for work.

I need to convert data in a form in MS Word to a table that I need to pull into Access. For example, the information contained
in the form is under titles name, address, age and then description (which can be up to 255 text).
The information in the form in MS Word isnt in a table, its just placed one item under another and its not placed in
a text field either, which might have made it a bit easier because Ive seen help on how to do that.

The original form is long with lots of data. Ive tried to simplify the problem with what's shown below.
Ive anybody could give some help or point me to a thread with something similar. I have looked through the
threads but couldnt see anything.

so name: John Anybody
DOB: dd/mm/yr Address: 123 Anyroad close, W12 9AA
Description: Text in here up to 255 characters


Thanks for any help and greatly appreciated!


sbrown106

ForestByte
02-15-2021, 10:41 AM
Hi,
Have a look at my free utility Eail Form Parsing on my web site (forestbyte_dot_com), the concept is the same. If the format stays the same you look for consecutive keywords and extract the portion in between as the data associated with the first one. For your example between the keyword "Name:" and the keyword "DOB:" you have the value for name, between "DOB:" and "Description:" you have the value for DOB,....
Cheers,
Vlad

OBP
02-16-2021, 03:42 AM
I agree, you can see my VBA for parsing a file at the top of this forum.
http://www.vbaexpress.com/forum/showthread.php?20548-How-to-import-a-text-file-with-more-than-255-fields-into-Access