I know how to use the shell function to run Adobe Acrobat from within VB, but how can I open a named file in Acrobat using shell or some other function?
Public Function GetDosName(ByVal sExpr As String) As String
Dim oFSO As Scripting.FileSystemObject
Dim oFile As Scripting.File
Dim oFolder As Scripting.Folder
On Error GoTo ERRORHANDLER
Set oFSO = New Scripting.FileSystemObject
sExpr = oFSO.GetAbsolutePathName(sExpr)
If oFSO.FileExists(sExpr) Then
Set oFile = oFSO.GetFile(sExpr)
GetDosName = oFile.ShortPath
ElseIf oFSO.FolderExists(sExpr) Then
Set oFolder = oFSO.GetFolder(sExpr)
GetDosName = oFolder.ShortPath
Else
End If
ERRORHANDLER:
Set oFSO = Nothing
Set oFolder = Nothing
Set oFile = Nothing
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.