Freshman
Registered User.
- Local time
- Today, 06:15
- Joined
- May 21, 2010
- Messages
- 437
Hi all,
I have a problem using AppActivate.
I'm using it along with a Shell command to open a Scanner application for my HP printer/scanner.
Then I pass a <Enter> key to it using the SendKey command.
This then brings up the "Save As" dialogue box which I'm very happy with.
At this stage I need to use SendKeys again to "paste" the filename into the Save As field, but the focus is now no longer on the dialogue box. Focus was returned to my original Form from where the code ran initially.
How do I get the focus back on the dialogue box to pass it the file name?
Thanks
Pierre
ReturnValue = Shell(DLookup("ScannerPath", "Settings"), vbNormalFocus)
AppActivate ReturnValue
SendKeys "~", True
PS: For anyone using an HP Printer, the "ScannerPath" is:
C:\Program Files\HP\HP LaserJet M1319 MFP Series\Scan To\hppscan0.exe
I have a problem using AppActivate.
I'm using it along with a Shell command to open a Scanner application for my HP printer/scanner.
Then I pass a <Enter> key to it using the SendKey command.
This then brings up the "Save As" dialogue box which I'm very happy with.
At this stage I need to use SendKeys again to "paste" the filename into the Save As field, but the focus is now no longer on the dialogue box. Focus was returned to my original Form from where the code ran initially.
How do I get the focus back on the dialogue box to pass it the file name?
Thanks
Pierre
ReturnValue = Shell(DLookup("ScannerPath", "Settings"), vbNormalFocus)
AppActivate ReturnValue
SendKeys "~", True
PS: For anyone using an HP Printer, the "ScannerPath" is:
C:\Program Files\HP\HP LaserJet M1319 MFP Series\Scan To\hppscan0.exe