0

I want to create hotlinks to open excel and image files but am having issues.

I fixed the issue with opening excel files by adding ""

cmd /c start excel.exe /r  "[% "Excel" %]"

However I can't get images to open??? rather than opening a specific program can qgis just open a file with the default system viewer?

cmd /c start rundll32 "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll" "[% "Location" %]"

I tried a few option with rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen %1 but they don't work.

Also tried enter image description here as per Answer from Nathan but I get "Unable to run command"

=== Original post follows.

I have looked at Adding a hotlink to an attribute field in QGIS and http://osgeo-org.1560.x6.nabble.com/Actions-HowTo-td4534256.html . The code from here launches excel but can't find the file...

I have the following in the properties-actions enter image description here

when I try to open it I get enter image description here It looks like the issue is with the spaces in the directory name...

P:\2013\361_xxx_Production\Input\Supply1\28-05-xxx_Application_Packages\Roads photos and form 2s\Roads Package 4\Form 2 Output xxx Roads Package 4.xls

it seems to be getting truncated at the first space in the directory. It is bad datastructure but I can't change this. Is there any way to fix this issue?

GeorgeC
  • 8,228
  • 7
  • 52
  • 136

1 Answers1

2

Try wrapping the expression in quotes:

cmd /c start excel.exe /r "[% "Excel" %]"

You can just use the Open action type

enter image description here

Nathan W
  • 34,706
  • 5
  • 97
  • 148