0
내가 SAP에서이 필드의 이름을 얻으려고에 필드 이름을 가져옵니다 :SAP
session.findById("wnd[0]/usr/subBLOCK:SAPLKACB:1015/ctxtCOBL-KOSTL")
을 나는 다음과 같은 코드가 주어진 화면에서 각 개체를 확인해야 :
Option Explicit
Sub SAPfields()
Dim sapguiauto As Object
Dim sapapp As Object
Dim sapcon As Object
Dim session As Object
Dim Area As Object
Dim i As Long
Dim Children As Object
Dim Obj As Object
Set sapguiauto = GetObject("SAPGUI")
Set sapapp = sapguiauto.GetScriptingEngine
Set sapcon = sapapp.Children(0)
Set session = sapcon.Children(0)
Set Area = session.findById("wnd[0]/usr")
Set Children = Area.Children()
For i = 0 To Children.Count() - 1
Set Obj = Children(CInt(i))
Debug.Print Obj.Name
Next i
Set Children = Nothing
Set Obj = Nothing
End Sub
객체 이름을 인쇄하면 다음과 같습니다.
subBLOCK:SAPLKACB:1015
정확한 필드를 얻으려면 어떻게해야합니까? OBJ("subBLOCK:SAPLKACB:1015").Children()
을 사용하려고 시도했지만 작동하지 않았습니다.
필드를 모두 순환 시키려면 도움이되지 않습니다. – Vinnie
어쨌든 다음을 수행 할 수 있어야합니다. Obj.setFocus 또는 Debug.Print Obj.Text – ScriptMan