Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set AppEXCEL = CreateObject("Excel.Application")
Set WorkBook = AppEXCEL.Workbooks.Add
Set Sheet = WorkBook.Worksheets(1)
Sheet.Columns("A:AN").Font.Name = "Arial"
Sheet.Columns("A:AN").Font.Size = "12"
For j = 1 To collection.count
Set doc = collection.GetNthDocument(j)
Dim row0() As String
Dim row1() As String
Dim row2() As String
For i = 0 To Ubound(doc.Date_Status)
x_Status = word(doc.Date_Status(i),"^",1)
x_Date = word(doc.Date_Status(i),"^",2)
Redim Preserve row0(i) As String
row0(i) = x_Status
Redim Preserve row1(i) As String
row1(i) = x_Date
Redim Preserve row2(i) As String
row2(i) = doc.AppNo(0)
Redim Preserve row3(i) As String
row3(i) = doc.Date_Created(0)
Next
With Sheet
Dim cRol As Integer
Dim cCol As Integer
cRol = j+1 '行
cCol = 1
.Cells(cRol,cCol).Value="表单编号"
cCol = 2 '列
For i=0 To Ubound(row2)
.Cells(cRol,cCol).Value=row2(i)
Next
cCol = 3
.Cells(cRol,cCol).Value="创建时间"
cCol = 4
For i=0 To Ubound(row1)
.Cells(cRol,cCol).Value=row3(i)
Next
cCol = 5 '列
For i=0 To Ubound(row0)
.Cells(cRol,cCol).Value=row0(i)
cCol = cCol + 2
Next
'cRol = j+1
cCol = 6
For i=0 To Ubound(row1)
.Cells(cRol,cCol).Value=row1(i)
cCol = cCol + 2
Next
End With
Sheet.Columns("A:AN").EntireColumn.AutoFit
Next
AppEXCEL.DisplayAlerts = False
AppEXCEL.visible = True
Set AppExcel = Nothing
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set AppEXCEL = CreateObject("Excel.Application")
Set WorkBook = AppEXCEL.Workbooks.Add
Set Sheet = WorkBook.Worksheets(1)
Sheet.Columns("A:AN").Font.Name = "Arial"
Sheet.Columns("A:AN").Font.Size = "12"
For j = 1 To collection.count
Set doc = collection.GetNthDocument(j)
Dim row0() As String
Dim row1() As String
Dim row2() As String
For i = 0 To Ubound(doc.Date_Status)
x_Status = word(doc.Date_Status(i),"^",1)
x_Date = word(doc.Date_Status(i),"^",2)
Redim Preserve row0(i) As String
row0(i) = x_Status
Redim Preserve row1(i) As String
row1(i) = x_Date
Redim Preserve row2(i) As String
row2(i) = doc.AppNo(0)
Redim Preserve row3(i) As String
row3(i) = doc.Date_Created(0)
Next
With Sheet
Dim cRol As Integer
Dim cCol As Integer
cRol = j+1 '行
cCol = 1
.Cells(cRol,cCol).Value="表单编号"
cCol = 2 '列
For i=0 To Ubound(row2)
.Cells(cRol,cCol).Value=row2(i)
Next
cCol = 3
.Cells(cRol,cCol).Value="创建时间"
cCol = 4
For i=0 To Ubound(row1)
.Cells(cRol,cCol).Value=row3(i)
Next
cCol = 5 '列
For i=0 To Ubound(row0)
.Cells(cRol,cCol).Value=row0(i)
cCol = cCol + 2
Next
'cRol = j+1
cCol = 6
For i=0 To Ubound(row1)
.Cells(cRol,cCol).Value=row1(i)
cCol = cCol + 2
Next
End With
Sheet.Columns("A:AN").EntireColumn.AutoFit
Next
AppEXCEL.DisplayAlerts = False
AppEXCEL.visible = True
Set AppExcel = Nothing