I have a VB app with a button that is to perform some tasks, one of them being to open a word document that has been saved on a server share.
This executable is run off of the server.
The problem is that the path to the word executable doesn't seem to work for the client machine if I use the long file name. If I shorten to 8.3 file name, then I am taking a chance that the user has Word installed to the specific directory I have coded. I thought that maybe I could removed the path statement to word from my Shell command, but that doesn't work. How can I make this shell statement open word on the user's machine with this document?
Here is the code:
Private Sub cmdCreateCMPR_DDRpt_Click()
'Creates the report then opens in Word
Shell ("isqlw -S GL_Server1 -d TesteDB1 -U sa -P 4illiad -i \\GL_Server1\IMData\CMPRRptNos_qry.sql -o \\GL_Server1\glexpdata\DD_CMPRImportNumbers_out.rtf"
Shell "c:\prgra~1\micros~1\office\winword.exe \\GL_Server1\glexpdata\DD_CMPRImportNumbers_out.rtf", vbNormalFocus
End Sub
This executable is run off of the server.
The problem is that the path to the word executable doesn't seem to work for the client machine if I use the long file name. If I shorten to 8.3 file name, then I am taking a chance that the user has Word installed to the specific directory I have coded. I thought that maybe I could removed the path statement to word from my Shell command, but that doesn't work. How can I make this shell statement open word on the user's machine with this document?
Here is the code:
Private Sub cmdCreateCMPR_DDRpt_Click()
'Creates the report then opens in Word
Shell ("isqlw -S GL_Server1 -d TesteDB1 -U sa -P 4illiad -i \\GL_Server1\IMData\CMPRRptNos_qry.sql -o \\GL_Server1\glexpdata\DD_CMPRImportNumbers_out.rtf"
Shell "c:\prgra~1\micros~1\office\winword.exe \\GL_Server1\glexpdata\DD_CMPRImportNumbers_out.rtf", vbNormalFocus
End Sub