-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIMPRIMIR_ZPMP.vbs
25 lines (25 loc) · 1.02 KB
/
IMPRIMIR_ZPMP.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
On Error Resume Next
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/shell/shellcont/shell").setCurrentCell -1,""
session.findById("wnd[0]/usr/shell/shellcont/shell").selectAll
session.findById("wnd[0]/usr/shell/shellcont/shell").contextMenu
session.findById("wnd[0]/usr/shell/shellcont/shell").selectContextMenuItem "&XXL"
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "$DESTINO$"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "$NOME$"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = $TAM$
session.findById("wnd[1]/tbar[0]/btn[11]").press