How to open FC via VBA
Posted: 16.01.2014, 08:15
In our office we use an Access database with its forms and VBA code as a central navigation panel (open maps, open files, open contacts,...).
To open maps we used to use Windows Explorer. More and more people are starting to use FreeCommander but we experience a problem with it.
In a linked table in another database the general pathnames are stored. Because of the structure of our network and mapnames, there are a lot of spaces in the names of the maps. When we use the following code in VBA to open a map with FreeCommander and there is a space in the pathname, FreeCommander opens the path until the first space.
How can we resolve this problem?
To open maps we used to use Windows Explorer. More and more people are starting to use FreeCommander but we experience a problem with it.
In a linked table in another database the general pathnames are stored. Because of the structure of our network and mapnames, there are a lot of spaces in the names of the maps. When we use the following code in VBA to open a map with FreeCommander and there is a space in the pathname, FreeCommander opens the path until the first space.
How can we resolve this problem?
Code: Select all
pad = (Me![Pathname]) & "map to open"
If Dir("C:\Program Files (x86)\FreeCommander XE\FreeCommander.exe") <> "" Then
stAppName = "C:\Program Files (x86)\FreeCommander XE\FreeCommander.exe " & pad
Call Shell(stAppName, 1)
Else
If Dir("C:\WINDOWS\explorer.exe ") <> "" Then
stAppName = "C:\WINDOWS\explorer.exe " & pad
Call Shell(stAppName, 1)
Else
MsgBox (" Message")
End If
End If