Have a subprocedure that uses docmd.transfertext to get data from a text file. Is there a vba command that will accomplish the same thing with a Word document (one that is password protected at that!)?
Have a subprocedure that uses docmd.transfertext to get data from a text file. Is there a vba command that will accomplish the same thing with a Word document (one that is password protected at that!)?
A Word document is not data, it is a string of encrypted text and formatting codes. Access and VBA can't read them. I'll go out on a limb and say import of word document is not possible. However, can be an attachment in an Attachment field of a record, although the password protection would be a complication to opening the attached file.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
was hoping could treat similar to a text file.
That's just it, Word .doc files are not 'text' files. Those would be .csv or .txt or .rtf and would have columnar structure that corresponds to fields of Access table.
There may be a way to link a Word document to Access table that allows typed values in a Word document to feed into table, but never looked into. I know Word document can pull data from Access but pushing is another matter.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
You might be able to VBA macro save the word doc as a text file and then import, but that's just asking for trouble.
Last edited by Stingaway; 01-04-2012 at 08:59 AM. Reason: I said "VGA" macro instead of "VBA" macro.. DYAC FTW.
Thanks everyone. I have another idea for what I want to do since this is not going to work. will be posting another thread.