抑制窗口安全警告消息

发布于 2025-01-30 14:54:43 字数 711 浏览 4 评论 0原文

我正在寻找方法来检查文件是否存在于SharePoint位置。我使用的是执行此操作的功能,但是一个消息框,标题为“ Windows安全警告”,并带有消息:“此页面正在访问其无法控制的信息。这构成了安全风险。您想继续吗?”

这是我使用的功能:

Public Function SP_File_Exists (URLString as String) as Boolean
    Dim oHttPRequst as Object
    
    if Len(Trim(URLString)) =0 Then 
    SP_File_Exists = False
    Exit Function

    Set oHttpRequest = CreateObject("MSXML2.XMLHTTP.6.0")
With oHttpRequest
   .Open "GET", URLString, False
   .Send
End With

If oHttpRequest.Status = 200 Or Left(oHttpRequest.Status, 1) = 3 Then  ' '300 to accommodate redirects
    SPFile_Exists = True
Else
    SPFile_Exists = False
End If
   
End Function

有没有办法抑制消息?我尝试使用DisplayAlerts属性,但它不起作用。我希望有人征服了这个问题。

I am looking for way to check if files exist in a SharePoint location. I am using a function that performs this action but a message box titled: Windows Security Warning, with the message "This pages is accessing information that is not under its control. This poses a security risk. Do you want to continue?"

Here is the function I am using:

Public Function SP_File_Exists (URLString as String) as Boolean
    Dim oHttPRequst as Object
    
    if Len(Trim(URLString)) =0 Then 
    SP_File_Exists = False
    Exit Function

    Set oHttpRequest = CreateObject("MSXML2.XMLHTTP.6.0")
With oHttpRequest
   .Open "GET", URLString, False
   .Send
End With

If oHttpRequest.Status = 200 Or Left(oHttpRequest.Status, 1) = 3 Then  ' '300 to accommodate redirects
    SPFile_Exists = True
Else
    SPFile_Exists = False
End If
   
End Function

Is there a way to suppress the message? I have tried using DisplayAlerts property and it doesn't work. I am hopeful that someone has conquered this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文