I build an application in VB6 to save document(of any type i.e. word , pdf, ppt) to Microsoft access database of which i have a combobox on VB form to select document to open to OLE so i can manipulate with it but its give me "runtime error 31031 method createlink of object failed" can anyone help me to solve it. my code is below
Private Sub CboFiles_Click()
If CboFiles.ListIndex <> -1 Then
If OLE1.AppIsRunning Then
Set objDoc = Nothing
OLE1.DoVerb vbOLEClosed
OLE1.Close
OLE1.Delete
End If
' OLE1.CreateEmbed App.path & "\" & CboFiles.Text
OLE1.CreateLink App.path & "\" & CboFiles.Text
'Set objDoc = OLE1.object
OLE1.DataChanged = True
'OLE1.SizeMode = 2
OLE1.FileNumber = 1
OLE1.Action = 7
'OLE1.DoVerb vbOLEOpen
OLE1.Visible = True
End If
End Sub
|