Revisiting FolderItem I now want to use f.Open with a parameter.
Am I using f.Open() wrong?
From Docs: FolderItem.Open(parameters as String = “” [,activate as Boolean])
My below code seems to pay no attention to parameters ("/A zoom=50%")
Var f As New FolderItem("C:\Users\Lennart\Documents\abc.pdf", Folderitem.PathModes.Native)
If f <> Nil And f.Exists Then
f.Open("/A zoom=50%")
End If
The command line gives the expexted result:
"C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" "C:\Users\Lennart\Documents\abc.pdf" /A zoom=50%
The order makes no difference, both work
It does not work with Launch either.
I tried other applications too, like LibreOffice Calc, with similar results.
However, a workaround is to make the document a parameter, instead of the FolderItem:
Var f As New FolderItem("C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe", Folderitem.PathModes.Native)
If f <> Nil And f.Exists Then
f.Open("/A zoom=100% C:\Users\Lennart\Documents\abc.pdf")
End If
Since the behaviour has been around for ages with Launch (at least in RS2011r2.1), I still wonder if I misinterpret the docs,
or maybe the bug is in the docs:
“If the FolderItem is an app, the app is opened. If the FolderItem is a document, the document is opened using its default app.”