0
votes

How could I programmatically open xyz program whenever I go for open specific word(.doc or .docx) file ?

For example, I am creating 1-screen(assume desktop application) where I will first ask 2-things from user,

step - 1. any word(.doc or .docx) file which is location inside user's system.

step - 2. target program(for example, any one audio file). Here I would like to add that it can be any thing. it can be .mp3, .mp4, .exe.

So that finally what will happen like whenever user will try to open(step-1) a particular word file at that time, specified audio file(step-2) will automatically open & play a nice song once.

how will I achieve this using programmatically (first priority will goes to java language) ?

Any help will really appreciate!!

UPDATE - https://drive.google.com/file/d/1T5Dw_GGeZFS6HUFOY2mYe2G79qkxXhz2/view?usp=sharing (please refer this link in order to understand my clear requirement & see what best you can do).

"problematically" ==> "programmatically" ?Weather Vane
Very unclear what you want, you say ”problematically”, you want it to fail?Fredrik
What is the point of sending a Word document to a media player? Or does the source file contain a play list?Weather Vane
Since you're most likely playing within the Windows operating system almost all files have an association with the or an application that is designed to run those particular files. With this in mind you can use Desktop.getDesktop().open(yourpathAndFileName);. Otherwise use ProcessBuilder.DevilsHnd
Use VBA in the Word document.Cindy Meister