S
saymard
Hi, here is my beginner problem
I wrote this code to access to a Word document from an Access
application. It works but I would like avoid the complete path for this
code to work on every machine.
the complete path is in my variables : accessDossier & operation
could someone tell me how to access directly to the document that is in
the file "Documents" at the same level as my Access application is ?
I need a relative path, I tried ..\Documents\Operation_1 but it didn't
work.
Here is the function to access to the word document :
Public Function hypertext(document As String)
Dim numErreur As Integer
Dim Word As Object
Dim accesDossier As String
Dim accesComplet As String
Dim operation As String
accesDossier = "C:\WINDOWS\Profiles\E SAYMARD\Bureau\Base
VUD\Documents\Operation_"
operation = forms("F_Op").Controls("Id_Ope")
accesComplet = accesDossier & operation '& "/"
Set Word = CreateObject("Word.Application")
Word.ChangeFileOpenDirectory accesComplet
Word.Documents.Open FileName:=document
Word.Visible = True
End Function
Thanks for your help
Eric
--
I wrote this code to access to a Word document from an Access
application. It works but I would like avoid the complete path for this
code to work on every machine.
the complete path is in my variables : accessDossier & operation
could someone tell me how to access directly to the document that is in
the file "Documents" at the same level as my Access application is ?
I need a relative path, I tried ..\Documents\Operation_1 but it didn't
work.
Here is the function to access to the word document :
Public Function hypertext(document As String)
Dim numErreur As Integer
Dim Word As Object
Dim accesDossier As String
Dim accesComplet As String
Dim operation As String
accesDossier = "C:\WINDOWS\Profiles\E SAYMARD\Bureau\Base
VUD\Documents\Operation_"
operation = forms("F_Op").Controls("Id_Ope")
accesComplet = accesDossier & operation '& "/"
Set Word = CreateObject("Word.Application")
Word.ChangeFileOpenDirectory accesComplet
Word.Documents.Open FileName:=document
Word.Visible = True
End Function
Thanks for your help
Eric
--