I have a form in Lotus notes consisting 100 fields.15 fields among the 100 are of subform that is within the form.
Now I want to migrate all the documents made on the form to excel sheet.
If I code for each and every 100 fields then the code will be too long.
How can I do this without coding so much.
The code I used is :-
Set db=ss.currentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
tlcount=col.count
count=1
'checks whether record exists
If Doc Is Nothing Then
Msgbox "There are no Document selected.",MB_OK + 64,"No Document found"
Exit Sub
End If
'Excel instance
Set xlApp=CreateObject("Excel.
Applicatio
n")
xlApp.Application.Visible = False
xlApp.Workbooks.Add
Set xlSheet = xlApp.Workbooks(1).Workshe
ets(1)
With xlsheet
.Range("A1").Value = "SNo."
//and so on for each column
Do While Not doc Is Nothing
count=count+1
With xlSheet
.Cells(row, 1).Value=doc.SNO(0)
//Code for Checkbox or multiple value field
Forall b In doc.PAC_Allergens_Choices
If string ="" Then
string =b
Else
string =string +" , " +b
End If
End Forall
.Cells(row, 54).Value=string
//and so on for all fields
Set doc = col.GetNextDocument(doc)
row=row+1
Loop
Print "Done"
Exit Sub