'WebPrintMailSpaceReport: Option Public Option Explicit Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim dc As NotesDocumentCollection Dim view As NotesView Dim cview As NotesView Dim row As Integer ' an example of how the agent should be called ' http://ServerName/YourDatabase.nsf/WebAgentName?OpenAgent&ViewNameToExport Dim ViewName As String Set db = session.CurrentDatabase Set db=session.currentdatabase Set doc = session.DocumentContext Dim path As String Dim pos As Integer Path= doc.Query_String_Decoded(0) pos = Instr(path, "&") viewname=Mid(path, pos+1) ' Print "view=" & viewName & " " ' debug only 'ViewName= "VewNametoExport" ' if you waht to hard code the view name Set view=db.GetView(ViewName) Call WriteViewasExcel (View) End Sub Sub WriteViewasExcel (view As Notesview) Dim fileNum As Integer Dim entry As NotesViewEntry Dim vc As NotesViewEntryCollection Dim rowstring As String Dim cns As String Print |Content-Type:application/vnd.ms-excel| Print |
| & c.title & | | | ' if your view title does not contain html End Forall ' Print cns Print |
| & colval & | | | End Forall Print |