Insert OLE object

M

Martin

Hi,

Please help! I have found this code and tried to adapt it for my own use
but the debug alerts me to the .Class line. Here is the code:

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String

MyFolder = Me!SearchFolder
' Get the search path.
MyPath = MyFolder & "\" & "*." & [SearchExtension]
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[OLEPath] = MyFolder & "\" & MyFile

[OLEFile].Class = "Paint.Picture"

[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [OLEPath]
[OLEFile].Action = acOLECreateEmbed
' Check for next OLE file in the folder.
MyFile = Dir
' Go to new record on form.
DoCmd.RunCommand acCmdRecordsGoToNew
Loop


I took this from a Access 2000 help file as I couldn't find one for Access
2003 which I am using. Can anyone help with this?

Thanks,

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top