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 26 27 28 29 30 31 32 33
| Dim Mapp As Object
Set SapGuiAuto = GetObject("SAPGUI")
Set Mapp = SapGuiAuto.GetScriptingEngine
If Not IsObject(Connection) Then
Set Connection = Mapp.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
On Error GoTo gestErr
'..contenu du code..
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Boite de dialogue "Enregistrer sous" du fichier export.MHTML => Ecrire une fonction qui renomme le fichier à sauvegarder
' et fixe son chemin
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
session.findById("wnd[0]/usr/cntlCATS_DETAILS/shellcont/shell").pressToolbarContextButton "&MB_EXPORT"
session.findById("wnd[0]/usr/cntlCATS_DETAILS/shellcont/shell").selectContextMenuItem "&XXL"
'Fermeture de fenetre SAP
session.findById("wnd[0]").Close
Exit Sub |
Partager