我需要Excel来告诉我,如果下面的按钮称为“附件列表”可供单击或不,但我无法得到它。下面是我尝试的代码:
Sub teste()
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApplication = SapGuiAuto.GetScriptingEngine
Set SAPConnection = SAPApplication.Children(0)
Set session = SAPConnection.Children(0)
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nme53n"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]").sendVKey 17
session.findById("wnd[1]/usr/subSUB0:SAPLMEGUI:0003/ctxtMEPO_SELECT-BANFN").Text = "Purchase Requisition"
session.findById("wnd[1]/usr/subSUB0:SAPLMEGUI:0003/ctxtMEPO_SELECT-BANFN").caretPosition = 8
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
Set botao = session.findById("/app/con[0]/ses[0]/wnd[0]/titl/shellcont/shell/")
End Sub
我设置了“botao”来从图像列表中获取所有8个按钮的数据,但是没有一个属性对我有帮助。
我需要这样的东西:
attach = botao.CurrentContextMenu.Children.Item(2).isfocused
代码botao.CurrentContextMenu.Children.Item(2)
将我引导到“附件列表”按钮,但是没有任何有价值的属性可以帮助我。
我真的需要这方面的帮助。
2条答案
按热度按时间sdnqo3pr1#
在我的测试附带一个不存在的附件下面的消息。
如果您的情况并非如此,您可以应用以下解决方法,例如:
问候,ScriptMan
55ooxyrt2#
我使用以下方法解决:
我只是不知道为什么有时代码有时是[...]/ses[0]/wnd[0],有时是[...]ses[0]/wnd[1]...所以,我做了两行,每一个案件。