Directory full of Word Files that have patient dictation that is transcribed by centralized transcription. I want to import the text into another MS SQL database. I am accomplishing this using an Access DB intermediary, because I am most familiar with this.
My problem is that I want to rename each file once it has been imported so I don't have to re-import each time and then check for duplicates. I wrote that routine and it is awfully slow!!!!
Here is the code that I have so far. You will see that the rename is comm'ed out since it gives me an error.
Any help is appreciated.
Public Function Grabdata()
Dim wdDoc As Word.Document
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strPath As String
Set wdDoc = Nothing
Set wdApp = Nothing
Dim strFile As String
Dim myFullFile As String
strPath = "X:\Shared\WPCWW\"
strFile = Dir(strPath, vbDirectory)
Do While strFile <> ""
If strFile <> "." And strFile <> ".." Then
'MsgBox "got this far"
'************* Start Repeating Section ***************
Set wdApp = New Word.Application
wdApp.Visible = False
myFullFile = strPath & strFile
'MsgBox strPath & strFile
Set wdDoc = wdApp.Documents.Open(myFullFile)
DoCmd.OpenForm "frmImport", acNormal, , , acFormAdd
Forms!frmImport![Dict] = wdDoc.Range.Text
DoCmd.Close acForm, "frmImport"
myFullFile1 = strPath & "*" & strFile
'Name myFullFile As myFullFile1
strFile = Dir()