Send Keys in windows folder (1 Viewer)

murray83

Games Collector
Local time
Today, 05:00
Joined
Mar 31, 2017
Messages
728
Afternoon

i am trying to get send keys to move down to a specific location in a folder onced its been opened from the form in access

but all it seems to do is open many, many windows of the folder

here is my code so far, have seen about wait but dosent pop up when typing

Code:
Private Sub cmd_AddPrinter_Click()
'opens up folder so you can easiley add zebra printer

Dim Foldername As String
Foldername = "\\d002win0003"

Shell "C:\WINDOWS\explorer.exe """ & Foldername & "", vbNormalFocus

'SendKeys "Down 6"
'SendKeys "Left 3"

End Sub
 

Minty

AWF VIP
Local time
Today, 05:00
Joined
Jul 26, 2013
Messages
10,355
This sounds highly problematic, what happens if there are unexpected files or folders in the target?

Why can't you specify the file or folder name explicitly?
 

murray83

Games Collector
Local time
Today, 05:00
Joined
Mar 31, 2017
Messages
728
This sounds highly problematic, what happens if there are unexpected files or folders in the target?

Why can't you specify the file or folder name explicitly?

the folder is full of printers and i'm wanting to try and automate connecting to that printer (its not a normal a3 or a4 paper printer) for printing from database as not everybody is savvy on how to do it

so could i just include the printer name in the string ???
 

Minty

AWF VIP
Local time
Today, 05:00
Joined
Jul 26, 2013
Messages
10,355
A report in Access can be saved with a specific printer as part of it's properties.
Provided that printer is available on the end user machine it will be used.

Does that help?
 

isladogs

MVP / VIP
Local time
Today, 05:00
Joined
Jan 14, 2017
Messages
18,186
Best to avoid SendKeys altogether.
Code that works in one version of Access may fail in another.
 

murray83

Games Collector
Local time
Today, 05:00
Joined
Mar 31, 2017
Messages
728
A report in Access can be saved with a specific printer as part of it's properties.
Provided that printer is available on the end user machine it will be used.

Does that help?

Yes

would i define it some where or is it in the options in the property sheet
 

Minty

AWF VIP
Local time
Today, 05:00
Joined
Jul 26, 2013
Messages
10,355
It's part of the page setup option in the report. In the dialog box that pops up you can set either
"Default Printer" or
"Use Specific Printer"

Once set it "Stays put" as an option.
 

Users who are viewing this thread

Top Bottom