josephbupe
Registered User.
- Local time
- Today, 23:37
- Joined
- Jan 31, 2008
- Messages
- 247
Hi,
I am attempting to open .txt files (with a notepad) from access following the hint at http://www.databasedev.co.uk/open_word_doc.html
But, I am getting an error "ActiveX component cant create object", which is taking me to the line in the module
Here is what I have:
Module:
I will appreciate your help.
Joseph
I am attempting to open .txt files (with a notepad) from access following the hint at http://www.databasedev.co.uk/open_word_doc.html
But, I am getting an error "ActiveX component cant create object", which is taking me to the line in the module
Code:
Set objApp = CreateObject("notepad.Application")
Here is what I have:
Module:
Code:
Sub OpenWordDoc(strDocName As String)
Dim objApp As Object
'Opens the document
Set objApp = CreateObject("notepad.Application")
objApp.Visible = True
objApp.Documents.Open strDocName
End Sub
Code:
Private Sub cmdOpenDoc_Click()
'Check to see that there is a document file path associated with the record
If IsNull(Me.FilePath) Or Me.FilePath = "" Then
MsgBox "Please Ensure There Is A File Path Associated " & _
"For This Document", _
vbInformation, "Action Cancelled"
' Exit Sub
' Else
'Check that the document specified in the file path is actually there
' If (Dir(Me.FilePath) = "") Then
' MsgBox "Document Does Not Exist In The Specified Location", _
' vbExclamation, "Action Cancelled"
Exit Sub
Else
'Opens document in Word
Call OpenWordDoc(Me.FilePath)
' End If
End If
End Sub
I will appreciate your help.
Joseph