Hi,
Can anyone help me with the following problem,
I'm trying to link documents to an Access97 table using the following piece of code and I need stop files from being seen if they have already been loaded.
Any suggestions on how I can do this, VBA's not a language that I've used much so don't worry about stating the obvious.
Thanks in advance,
Roal
"You need to learn to run before you can walk"
Can anyone help me with the following problem,
I'm trying to link documents to an Access97 table using the following piece of code and I need stop files from being seen if they have already been loaded.
Any suggestions on how I can do this, VBA's not a language that I've used much so don't worry about stating the obvious.
Code:
Private Sub cmdLoadOLE_Click()
Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String
MyFolder = "H:\DATA\Correspondence Database\Documents"
MyPath = MyFolder & "\" & "*.doc"
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[DocumentPath] = MyFolder & "\" & MyFile
'[OLEFile].Class = "word.Document"
[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [DocumentPath]
[OLEFile].Action = acOLECreateEmbed
MyFile = Dir
DoCmd.RunCommand acCmdRecordsGoToNew
Loop
End Sub
Roal
"You need to learn to run before you can walk"