wizardgmb
12-14-2011, 03:34 PM
This post has gotten to be rather long so in deference to those of you that don’t have a lot of time to read I’m going to present the nuts and bolts of my VBA query first and then follow it with the background information.
I would like to know if it’s possible to write VBA code for Word that will run continuously while Word is open, look for three specific keyboard key combinations that can be defined as needed and then pass a series of predefined key combinations to another process/window. For instance, during the entry of “Jack and Jill went up the hill to fetch a pail of water.”, the key sequence (ignoring the brackets) [alt-shift-F9] is included after the word “fetch”. The VBA routine needs to recognize [alt-shift-F9] then pass [control-p], [control-r] and [control-r] to a process running in another window as if it came directly from the keyboard. This has to be entirely transparent to the typist; nothing should appear in the open document other than “Jack and Jill went up the hill to fetch a pail of water.” Minimal perceptible character entry delay can occur due to recognition and transmission of character sequences. Windows focus needs to remain on the Word window for the entire time.
My VBA experience is limited and it’s been at least six years since I used it. Can this be done and if so can anyone point me to similar examples or reference texts? Any assistance will be greatly appreciated!
Regards,
George
Background:
My wife is a medical transcriptionist who after 15 years of transcribing voicemail files into Word documents has been forced onto an electronic medical records system. The medical practice chose a piece of rubbish called Medent that is hosted on a UNIX server and uses misappropriated LINUX code to create a user interface running under Windows. It’s a big sell in Upstate NY where it was created and is maintained; support your local industry and it will support you… The stuff is so badly written/executed that it doesn't set up a proper Windows install/uninstall and has a single registry entry that as far as I can see doesn't get accessed. Medent did the absolute bare minimum to interface to Windows desktop, directory service, keyboard and mouse. It looks great to the physicians that sign the check but it ends up being a pain to those that have to do more than dictate into it and look up patient records.
The system takes in voice files from the practitioners, stores them on the UNIX server until needed and then downloads them to the transcriptionist's Windows pc as part of its local scratch file rather than individual .mp3 or .wav files. In order to control the player, one has to have a special Infinity IN-PI foot pedal that gets connected in series with a PS2 keyboard. After programming, the pedal sends out the [control-p] command when the play pedal is pressed, [control-r] for rewind and [control-f] for fast forward. It's no different than pressing the respective keyboard combinations. If your computer is new enough that it doesn’t have PS2 ports, you have to get a PS2 to USB adapter and a PS2 keyboard to at least program the pedal.
The real nightmare begins when one tries to use Medent. The player only offers push on push off play pedal functionality rather than play as long as the pedal is depressed. Obviously, the later isn't possible because a continuous stream of [control-p] characters would preempt normal keyboard entry. Medent has adjustable backspace after play ends but it doesn't work, thus requiring rewind pedal usage for this basic functionality. The document entry template offerings are nasty and as far as we can see, spell checking is minimal or non-existent.
The best remedy for Medent’s shortcomings would be to use an external transcriber program such as Express Scribe and Word (with a medical spell checker) then copy and paste from Word into Medent. An external transcriber isn't a direct option because the audio files aren't available in recognizable form. Using Word directly isn't an option because as soon as focus is placed on the Word rather than Medent window, the foot pedal commands are sent to Word. Pressing the play pedal brings up the print options window! Had Medent written proper Windows software and accessed the USB or the serial ports or both for pedal commands, the keyboard could be used for Word without conflict.
My current solution is to play the dictation from Medent, record the audio with SoundTap streaming audio recorder, load the resulting files into Express Scribe, transcribe them into Word and then paste into Medent. This wastes considerable time spent listening to the dictation without transcribing. Also, while web surfing is the preferred diversion while recording, one has to be careful not to open pages with streaming audio that will garble the dictation audio file. Also, games or any action that generates a Windows sound is incompatible.
I see two possible solutions to the Medent problem. The first is to write C++ or Java code that will take standard USB transcription pedal depression commands, convert them to Medent pedal commands and pass them to the Medent window as keyboard commands. This is essentially what Medent is too lazy or cheap or both to do, forcing me to make the expenditure. Since I’m not a C++ or Java programmer it will cost some bucks to farm the work out. The alternative is to try doing the same thing with VBA and Word. While forcing the functionality into Word isn’t ideal it’s far better than what Medent alone offers.
I would like to know if it’s possible to write VBA code for Word that will run continuously while Word is open, look for three specific keyboard key combinations that can be defined as needed and then pass a series of predefined key combinations to another process/window. For instance, during the entry of “Jack and Jill went up the hill to fetch a pail of water.”, the key sequence (ignoring the brackets) [alt-shift-F9] is included after the word “fetch”. The VBA routine needs to recognize [alt-shift-F9] then pass [control-p], [control-r] and [control-r] to a process running in another window as if it came directly from the keyboard. This has to be entirely transparent to the typist; nothing should appear in the open document other than “Jack and Jill went up the hill to fetch a pail of water.” Minimal perceptible character entry delay can occur due to recognition and transmission of character sequences. Windows focus needs to remain on the Word window for the entire time.
My VBA experience is limited and it’s been at least six years since I used it. Can this be done and if so can anyone point me to similar examples or reference texts? Any assistance will be greatly appreciated!
Regards,
George
Background:
My wife is a medical transcriptionist who after 15 years of transcribing voicemail files into Word documents has been forced onto an electronic medical records system. The medical practice chose a piece of rubbish called Medent that is hosted on a UNIX server and uses misappropriated LINUX code to create a user interface running under Windows. It’s a big sell in Upstate NY where it was created and is maintained; support your local industry and it will support you… The stuff is so badly written/executed that it doesn't set up a proper Windows install/uninstall and has a single registry entry that as far as I can see doesn't get accessed. Medent did the absolute bare minimum to interface to Windows desktop, directory service, keyboard and mouse. It looks great to the physicians that sign the check but it ends up being a pain to those that have to do more than dictate into it and look up patient records.
The system takes in voice files from the practitioners, stores them on the UNIX server until needed and then downloads them to the transcriptionist's Windows pc as part of its local scratch file rather than individual .mp3 or .wav files. In order to control the player, one has to have a special Infinity IN-PI foot pedal that gets connected in series with a PS2 keyboard. After programming, the pedal sends out the [control-p] command when the play pedal is pressed, [control-r] for rewind and [control-f] for fast forward. It's no different than pressing the respective keyboard combinations. If your computer is new enough that it doesn’t have PS2 ports, you have to get a PS2 to USB adapter and a PS2 keyboard to at least program the pedal.
The real nightmare begins when one tries to use Medent. The player only offers push on push off play pedal functionality rather than play as long as the pedal is depressed. Obviously, the later isn't possible because a continuous stream of [control-p] characters would preempt normal keyboard entry. Medent has adjustable backspace after play ends but it doesn't work, thus requiring rewind pedal usage for this basic functionality. The document entry template offerings are nasty and as far as we can see, spell checking is minimal or non-existent.
The best remedy for Medent’s shortcomings would be to use an external transcriber program such as Express Scribe and Word (with a medical spell checker) then copy and paste from Word into Medent. An external transcriber isn't a direct option because the audio files aren't available in recognizable form. Using Word directly isn't an option because as soon as focus is placed on the Word rather than Medent window, the foot pedal commands are sent to Word. Pressing the play pedal brings up the print options window! Had Medent written proper Windows software and accessed the USB or the serial ports or both for pedal commands, the keyboard could be used for Word without conflict.
My current solution is to play the dictation from Medent, record the audio with SoundTap streaming audio recorder, load the resulting files into Express Scribe, transcribe them into Word and then paste into Medent. This wastes considerable time spent listening to the dictation without transcribing. Also, while web surfing is the preferred diversion while recording, one has to be careful not to open pages with streaming audio that will garble the dictation audio file. Also, games or any action that generates a Windows sound is incompatible.
I see two possible solutions to the Medent problem. The first is to write C++ or Java code that will take standard USB transcription pedal depression commands, convert them to Medent pedal commands and pass them to the Medent window as keyboard commands. This is essentially what Medent is too lazy or cheap or both to do, forcing me to make the expenditure. Since I’m not a C++ or Java programmer it will cost some bucks to farm the work out. The alternative is to try doing the same thing with VBA and Word. While forcing the functionality into Word isn’t ideal it’s far better than what Medent alone offers.