hi, i need an answer for this urgently. i need to able to copy the field name and paste at other place. any solution? please advise
Subject: copy a field to paste at eg. notepad, excel etc
I assume you mean as a developer?
Lotus Script or Formula language?
Subject: copy a field to paste at eg. notepad, excel etc
Here is a lotus script to copy all fields of a form into excel.Before running this script you need to create a blank excel file “C\Temp\FieldsExportTemp.xls”
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim strNomFichier As String
Dim fileTemplate As String
Dim xlapp, xlsheet As Variant
Dim fileExport As String
On Error Goto Errl
Set db = session.CurrentDatabase
'Template of excel to insert fields
filePath = "C:\Temp\"
fileTemplate = filePath + "FieldsExportTemp.xls"
'Input the field names into excel
Set xlapp = CreateObject("Excel.application")
xlapp.Visible = False
xlapp.Workbooks.Open(fileTemplate)
Set xlsheet = xlapp.Workbooks(1).Worksheets(1)
'First cell position to insert
rowStart = 2
colStart = 1
'Form for which fields are to be exported
strForm = "Rapport"
Forall form In db.Forms
If form.Name = strForm Then
If Isempty(form.Fields) Then
Print form.Name & " has no fields"
Else
Forall field In form.Fields
fieldCount = fieldCount + 1
'Inserting fields into the excel sheet one by one
xlsheet.Cells(rowStart,colStart).Value = Cstr(field)
rowStart = rowStart + 1
End Forall ' End of all fields
End If
End If
End Forall 'End of all forms
'Excel file into which fields are to be inserted and saved
fileExport = filePath + "FieldsExport.xls"
'save and close the new excel
Call xlapp.activeworkbook.saveas(fileExport)
xlapp.activeworkbook.close
xlapp.quit
Set xlapp = Nothing
Exit Sub
Errl:
Msgbox "TestExport-> Error : Line("& Str$(Erl()) &") Err : " & Str(Err) & " - " & Error$
Print "TestExport-> Error : Line("& Str$(Erl()) &") Err : " & Str(Err) & " - " & Error$
xlapp.activeworkbook.close
xlapp.quit
Set xlapp = Nothing
Kill fileExport
Exit Sub
End Sub