Ich dachte ich kann mich mit Tab durch den Dialog angeln, das funktioniert bescheiden, sobald die Einstellungen im Dialog anders sind,
"fehlt"
ein Tab-Befehle und springt nicht mehr die richtigen Felder an.
Sub
Dialog_Print_Out()
Dim
FSO
As
New
FileSystemObject
Dim
WshShell
As
Object
Set
FSO = CreateObject(
"Scripting.FileSystemObject"
)
Set
WshShell = CreateObject(
"Wscript.Shell"
)
Application.Wait (Now + TimeValue(
"0:00:05"
))
OCCDoc.PrintOut
Application.Wait (Now + TimeValue(
"0:00:05"
))
With
WshShell
.SendKeys (
"{TAB}"
)
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
.SendKeys
"+{TAB}"
Application.Wait (Now + TimeValue(
"0:00:01"
))
.SendKeys (
"{ENTER}"
)
Application.Wait (Now + TimeValue(
"0:00:03"
))
.SendKeys PDF_Ordner
Application.Wait (Now + TimeValue(
"0:00:03"
))
.SendKeys (
"{ENTER}"
)
Application.Wait (Now + TimeValue(
"0:00:01"
))
.SendKeys
"{TAB}"
Application.Wait (Now + TimeValue(
"0:00:01"
))
.SendKeys
"{TAB}"
Application.Wait (Now + TimeValue(
"0:00:01"
))
.SendKeys
"+{TAB}"
Application.Wait (Now + TimeValue(
"0:00:01"
))
.SendKeys
"{TAB}"
Application.Wait (Now + TimeValue(
"0:00:03"
))
.SendKeys (
"{ENTER}"
)
Application.Wait (Now + TimeValue(
"0:00:03"
))
.SendKeys
"%{F4}"
Debug.Print i &
" "
& Dateiname