G
Guest
I try to close a Word file from Access with code:
The filename is saved in a field type hyperlink.
***** collecting name and directory
Do
SlashPlaceInt = 0
SlashPlaceInt = InStr(1, file_name, "\")
If SlashPlaceInt = 0 Then
Exit Do
Else
StringLen = Len(file_name)
StringLen = StringLen - SlashPlaceInt
StringLocation = StringLocation & "\" & Left(file_name,
SlashPlaceInt)
file_name = Right(file_name, StringLen)
End If
Loop
'Start Microsoft Word
Set wordApp = GetObject(, "Word.Application")
'Check wether File exists
Set fs = Application.FileSearch
'Microsoft Office Object Library has to be installed
With fs
*** Here is the LookIn set
.LookIn = StringLocation
.FileName = file_name
When I check in the debugger, the LookIn always is "C:\"
I have copied my code from a different form in the database, there it is
working fine.
The filename is saved in a field type hyperlink. Could the hyperlink type be
the reason and is there a work around?
The filename is saved in a field type hyperlink.
***** collecting name and directory
Do
SlashPlaceInt = 0
SlashPlaceInt = InStr(1, file_name, "\")
If SlashPlaceInt = 0 Then
Exit Do
Else
StringLen = Len(file_name)
StringLen = StringLen - SlashPlaceInt
StringLocation = StringLocation & "\" & Left(file_name,
SlashPlaceInt)
file_name = Right(file_name, StringLen)
End If
Loop
'Start Microsoft Word
Set wordApp = GetObject(, "Word.Application")
'Check wether File exists
Set fs = Application.FileSearch
'Microsoft Office Object Library has to be installed
With fs
*** Here is the LookIn set
.LookIn = StringLocation
.FileName = file_name
When I check in the debugger, the LookIn always is "C:\"
I have copied my code from a different form in the database, there it is
working fine.
The filename is saved in a field type hyperlink. Could the hyperlink type be
the reason and is there a work around?