0
votes

I am trying to extract rich text content in document to HTML File.

Searched for code in this forum. Found below code.

Code is extracting contents into HTML file, with "Anonymous" access at the database level.

But after removing "Anonymous" from ACL and tried to pass username and password along with the request. But it is extracting authentication page ( not the rich text content in document). ( Server is SSO disabled).

Any ideas how to do the authentication on "get" request?

Thanks in Advance..

Function GetHtmlFromField(docunid As string, fieldname As String) As String
    Dim obj

    Set obj = CreateObject("msxml2.ServerXMLHTTP.6.0")

    obj.open "GET", "Url" + docunid + "/" + fieldname + "?openfield&charset=utf-8", False,"username", "password"
    //obj.SetRequestHeader "encoding", "utf-8"
    //obj.setTimeouts 5000, 5000, 10000, 10000
    obj.SetRequestHeader "Authorization", "Basic MY_AUTH_STRING"
    obj.send("")

    Dim html As String
    html = Trim$(obj.responseText)

    GetHtmlFromField = html
    End Function
1

1 Answers

0
votes

You can try the following format for the URL:

username:password@http://server/mydb.nsf/docunid [...]

BTW you should check

obj.open "GET", "Url" + docunid

Url should be a variable I think.