如何填写SharePoint网页的文本域?

How to fill the text field on web-page of SharePoint?

我需要在我公司的内部站点 SharePoint 上填写文本字段。但是当我开始我的代码时,在填充我的值之前引发下一个错误:

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="">

IE 在更改安全区域时打开浏览器的新实例(例如,当从 Internet 导航到 Intranet 时),因此您将丢失 IE 对象。您可以更改 IE 中的安全设置,IIRC InternetLocal intranet 必须具有相同的安全级别,or/and enable protected mode 打勾。如果这不起作用,请尝试在 custom level.

中启用 websites in less privileged web content zone can navigate into this zone