Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading Multiple OLE objects

Status
Not open for further replies.

Roal

Technical User
Mar 27, 2003
12
GB
Hi,

I would like to store a lot of scand documents in an Access97 table.

I've used the following code in the onclick event for my load documents button and it works fine, but I would like to amend it to stop files that have already been loaded from being loaded again.

I know I could just manually move the documents into a new directory once they've been loaded, but I wan't to keep things simple for the users and wont be arround to hold their hands if they forget.

Of course a coded method of moving the files would also solve the problem :)

But my VB skills are still being developed and I've yet to come accross a way to do this.

Thanks in advance.

Roal

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 = Me!SearchFolder

MyPath = MyFolder & "\" & "*." & [SearchExtension]

MyFile = Dir(MyPath, vbNormal)
    Do While Len(MyFile) <> 0
        [DocumentPath] = MyFolder & &quot;\&quot; & MyFile
        [OLEFile].Class = [OLEClass]
        [OLEFile].OLETypeAllowed = acOLEEmbedded
        [OLEFile].SourceDoc = [DocumentPath]
        [OLEFile].Action = acOLECreateEmbed
        
    MyFile = Dir
    
DoCmd.RunCommand acCmdRecordsGoToNext



Loop
        


End Sub
[\Code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top