How to open dopus from VBA to specified directory and screen location

I am writing an app in Access 2013 with Windows 7, 8.1 and 10 and would like to develop code to open Dopus at a specified directory, and secondly at a given screen position. Are there command line parameters that will allow this, as with the Shell command? I can use the Shell command to open Dopus.exe but am unaware of parameters to specify a specific directory or screen position. I believe that once it is open I can use some previous code to place the window so that is less important, but if such parameters are available for the command line, would like to know. Thanks.

You can use DopusRT.exe /acmd (or /cmd) to run Opus commands from outside of Opus.

The Go command shuld have all you need to open the window. e.g.

Go "C:\Program Files" NEW="240,300,640,480"

Putting both together:

"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd Go "C:\Program Files" NEW="240,300,640,480"

Note that dopusrt.exe runs commands asynchronously. The window may not yet be open when dopusrt.exe returns control to your VBA code.

Thanks, Leo, that completely answered my question.

Hi,

Sorry to bring up and old thread but I have a similar problem - however I have an MS Access database that is run on different machines, some have dopus, some dont. But the database has buttons which launch folders as per the above.

Apologies if this is a stupid question, but is the best way to code this VBA with an IF statement to check if Dopus is installed? or is there an better shell command that would launch Dopus regardless of whether its installed or not? It will always be set as an explorer replacement.

If there is a dev who has experience of VBA and dopus drop me a message, I may need ongoing support from a freelancer.

Thanks

If you just want the folder to open in a window, and don't care about the size or position like the original question, then you can avoid checking for Opus or doing anything Opus specific.

If Explorer Replacement is turned on on the machines with Opus, then you just need to launch the folders and they'll open in Opus. The machines without Opus will open the folders in File Explorer.

The Shell.ShellExecute method should let you do that from VBA. Omit the "operation" parameter so it runs the default verb and it should work with both Opus and Explorer.

1 Like

Thanks Leo!

In the end Application.FollowHyperlink worked for me as I couldnt figure out ShellExecture :laughing:

1 Like