Hello!
i'd like to print the reservations already made.In this case, i have to mark each file that i want to print. i 'd like to insert this code on my script everytime it needs to drop down the bar, otherwise it will stop printing.
session.findById("wnd[0]").sendVKey 82
Thanks!
Sub Press()
Dim application
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]/tbar[0]/okcd").Text = "/nzmb25"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtWERKS-LOW").Text = "1104"
session.findById("wnd[0]/usr/ctxtWERKS-HIGH").Text = ""
session.findById("wnd[0]/usr/ctxtBDTER-LOW").Text = Range("I5").Value 'DATA
session.findById("wnd[0]/usr/txtUSNAM-LOW").Text = Range("I7").Value 'USURARIO
session.findById("wnd[0]/usr/txtUSNAM-LOW").SetFocus
session.findById("wnd[0]/usr/txtUSNAM-LOW").caretPosition = 5
session.findById("wnd[0]/tbar[1]/btn[8]").press
For i = Range("I2").Value To Range("J2").Value 'Count
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = True 'alteração para as celulas de acordo com o loop
session.findById("wnd[0]/usr/chk[1," & i & "]").SetFocus
session.findById("wnd[0]/tbar[1]/btn[20]").press
session.findById("wnd[1]/tbar[0]/btn[6]").press
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").SetFocus
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").SetFocus
session.findById("wnd[2]/tbar[0]/btn[86]").press
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = False
Next i
End Sub
i'd like to print the reservations already made.In this case, i have to mark each file that i want to print. i 'd like to insert this code on my script everytime it needs to drop down the bar, otherwise it will stop printing.
session.findById("wnd[0]").sendVKey 82
Thanks!
Sub Press()
Dim application
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]/tbar[0]/okcd").Text = "/nzmb25"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtWERKS-LOW").Text = "1104"
session.findById("wnd[0]/usr/ctxtWERKS-HIGH").Text = ""
session.findById("wnd[0]/usr/ctxtBDTER-LOW").Text = Range("I5").Value 'DATA
session.findById("wnd[0]/usr/txtUSNAM-LOW").Text = Range("I7").Value 'USURARIO
session.findById("wnd[0]/usr/txtUSNAM-LOW").SetFocus
session.findById("wnd[0]/usr/txtUSNAM-LOW").caretPosition = 5
session.findById("wnd[0]/tbar[1]/btn[8]").press
For i = Range("I2").Value To Range("J2").Value 'Count
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = True 'alteração para as celulas de acordo com o loop
session.findById("wnd[0]/usr/chk[1," & i & "]").SetFocus
session.findById("wnd[0]/tbar[1]/btn[20]").press
session.findById("wnd[1]/tbar[0]/btn[6]").press
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").SetFocus
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").SetFocus
session.findById("wnd[2]/tbar[0]/btn[86]").press
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = False
Next i
End Sub
Regards,