如何填写SharePoint网页上的文本字段? [英] How to fill the text field on web-page of SharePoint?
问题描述
我需要填写公司内部网站SharePoint上的文本字段.但是,当我启动代码时,在填充我的值之前,下一个错误引发:
I need to fill the text field on internal site SharePoint in my company. But when I start my code, before the filling me value next error raise:
运行时错误:自动化错误,所调用的对象已与其客户端断开连接
Run-time error: Automation Error, The object invoked has disconnected from its clients
请帮助
Sub Authority()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate "OurInternalSite"
While ie.Busy Or ie.ReadyState<>4:DoEvents:Wend
ie.document.getelementbyid("ComboBox29-input").Value = "My text"
End Sub
按钮代码
<input data-is-interactable="true" id="ComboBox29-input" class="ms-ComboBox-Input css-93" type="text" aria-expanded="false" aria-autocomplete="inline" role="combobox" spellcheck="false" autocapitalize="off" autocomplete="off" data-lpignore="true" value="">
推荐答案
当更改安全区域(例如,从Internet到Intranet导航)时,IE打开浏览器的新实例,因此,您将丢失IE对象.您可以在IE中更改安全设置,IIRC Internet
和Local intranet
必须具有相同的安全级别,或/和enable protected mode
被打勾.如果这样不起作用,请尝试在custom level
中启用websites in less privileged web content zone can navigate into this zone
.
IE opens new instance of the browser when changing security zone (eg when navigating from internet to intranet), so as a consequence you're losing your IE object. You can change security settings in IE, IIRC Internet
and Local intranet
must have the same level of security, or/and enable protected mode
ticked. If that doesn't work, try enabling websites in less privileged web content zone can navigate into this zone
in custom level
.
这篇关于如何填写SharePoint网页上的文本字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!