I want to open a file in WordPad from Access. This code works correctly.
However, if the filename (or folder name) contains a blank, I get the non-trappable error "Failed to open document." No message number.
How can I open a file with Shell if the filename contains a blank?
Code:
Private Sub cmdOpenRTF_Click()
Dim stAppName As String
stAppName = "C:\Program Files\Windows NT\Accessories\WordPad.exe " & "D:\Convert\Convert.rtf"
Call Shell(stAppName, vbNormalFocus)
End Sub
How can I open a file with Shell if the filename contains a blank?
Comment