Reputation: 33
I'm currently working on transferring a lot of MS Word forms into a database system.
My approach is currently:
Hopefully at the end of these stages, I will obtain a fairly collated excel file of information that can be transferred onto the database system.
My question is, since I have a lot of word documents (and I feel like a robot after going through about 100 of them), can I automate the process of 1) 2) and 3)?
Any help would be much appreciated, I have scripted in python before and done some simple programming, but any solution is welcome.
Upvotes: 3
Views: 8788
Reputation: 11
I recommend you to use the following free & simpler solution: multidoc-converter.com/en/download/index.html
It worked for me.
Upvotes: 0
Reputation: 176219
You can use a VBA macro to automate steps 1-3. Using the Document.SaveAs
method you can save the form data only to a txt file:
ActiveDocument.SaveAs ActiveDocument.FullName & ".txt", _
WdSaveFormat.wdFormatText, SaveFormsData:=True
Then you can call this SaveAs
method in loop over all documents in a given folder:
Sub SaveAllFormData(path As String)
Dim doc As Document
Dim fileName As String
fileName = Dir(path & "*.doc")
' Loop through all .doc files in that path
Do While fileName <> ""
Set doc = Application.Documents.Open(path & fileName)
' Save form data
doc.SaveAs2 doc.FullName & ".txt", WdSaveFormat.wdFormatText, SaveFormsData:=True
doc.Close wdDoNotSaveChanges
fileName = Dir
Loop
End Sub
If you need help setting up and running the macro, check out the docs: Create or run a macro
Upvotes: 3