I generate docx documents and save them on disk. Then if I want to open that document from within my application with IShellService.shellOpen I get a window message "Can't find file 'path\filename.docx'".
I can open this file directly from windows explorer by a double click. I can open other .docx files. The path is correct. It is the same after closing and reopening my application, so nothing is kept in memory (even after restarting the computer.)
So what goes wrong with opening this file with IShellService.shellOpen ?
In some generated file names there were two spaces after each other e.g. 'My new file.docx' This was hardly visible on the screen. This file could not be opened with IShellService.shellOpen but it could be opened with java.awt.Desktop.getDesktop().open.
After replacing the double space with a single one (at generation time) it works again.
PS normally there is no problem when opening a filename with two spaces in it, but it seems there is when it is generated by docx4j, did not investigate that any further.