acces/word xp + vba

  • Thread starter Thread starter Hugo Lefebvre
  • Start date Start date
H

Hugo Lefebvre

I use the following code for a button on an Access2002 form:

Private Sub Knop62_Click()

Dim strVollcommando As String
strVollcommando = "c:\program files\microsoft
office\office10\winword.exe c:\test\test.doc"
Call Shell(strVollcommando, 1)

End Sub


With Access2000, there is no problem (I know, the path for Word2000 is
....\office\... and not ..\office10\...). In Access2002, it doesn't work.
There seems to be a 'rights'-problem. The rights for the map 'c:\test' and
for the file 'test.doc' are: all rights to everyone. The file system is NTFS
on a WindowsXP PC.

Can anyone help me?

End Sub
 
You don't even have to bother with the application name.

If you use the following, it will launch any application based on what
happens when you click on it. This means that the following work for
different versions, and even different word processors...


strVollcommando = "c:\test\test.doc"
application.FollowHyperlink

Also, as for checking the rights, simply browse to the file and double click
on it. If you can double click on the file and launch the application, then
the above will also work.
 
Back
Top