Question

i have to open files using LotusNotes and i tried with this script:

dim file as string
file="C:\invoice.pdf"
result=Shell("H:\AdobeReader\AcroRd32.exe "+ file)

and it work well.

But when i try to open file where there is a space character in the file name (ex: "C:\All Invoice\invoice.pdf") the command shell recognizes the file name as "C:\All" without all character after the space. there is someone can help me ? thank's

Was it helpful?

Solution

Just set the file in quotation marks like this way:

Dim file As String
Dim result As variant
file="C:\All Invoice\invoice.pdf"
result=Shell(|H:\AdobeReader\AcroRd32.exe "| + file + |"|)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top