Shell Command HELP!!

J

Jasper Recto

I have a vb script(see below) in Access 2000 that is attached to a button.
The script is design to ask for a Part Number which is also the name of a
word .doc file. It then feeds that value into a path statement. Then a
shell command is supposed to open the specific word file. I can't seem to
get it to work.

Any ideas would be greatly appreciated!!

Private Sub Command3_Click()
Dim Title As String
Dim Default As String
Dim MyValue As Variant
Dim MyText As String
Dim MyPath As String
Dim Word
Dim DocPath

Title = "File Open"
Default = ""
MyText = "Enter Part Number in the format" & vbCr & _
"12345678"

MyPath = "C:\Vantage Documents\"

GetInput:
MyValue = InputBox(MyText, Title, Default)
If MyValue = "" Then
End 'quit subroutine
End If
On Error GoTo Oops 'just in case
DocPath = MyPath & "PN " & MyValue & _
"\" & MyValue
Word = Shell("C:\Program Files\Microsoft Office\Office\Winword.EXE &
DocPath", 1)
End 'End subroutine

Oops:

End Sub
 

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