it can be done and you are on the right path so the issue is with the code
1) Post the code
2) Create a test database that allows anonymous access
Create an agent like below
Instead of trying to get your url "
http://server.nsf/viewname?openview" get the url to the agent. this will log the username and cookie value to help in debugging.
Sub Initialize
Dim s As New notessession
Dim doc As NotesDocument
Dim auditDoc As NotesDocument
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Set doc = s.DocumentContext
Set auditdoc = db.CreateDocument
auditDoc.Form = "Audit"
auditDoc.REMOTE_USER = doc.REMOTE_USER(0)
auditDoc.Body = doc.Request_Content(0)
auditDoc.Cookie = doc.HTTP_COOKIE (0)
Call auditDoc.Save(True, True)
End Sub