Hi,
I have a problem with notes 4.6 and dont know what to do or where to start;
The problem:
I have a database with a form and view
i have another database with exactly the same form as above and exactly the same view as above.
the only difference between the views is the data (ie. one may have 4 documents and the other may have 3 documents etc)
what am i trying to do is do an txt export
from the 1st database so that it exports whatever is in the specified view and then export the view in the 2nd database and to then combine the documents exported into one file.
My process is:
first click on the action button in the view
this runs an agent that brings up a prompt box so that you can export documents based on a year;
TView:= "ExportSPSS2V";
ENVIRONMENT tViewTitle2 := TView;
TViewList :=
@If(TView = "ExportSPSS2V";
@DbColumn(Notes:"NoCache";"";"ExportSPSSMYV";2);
"");
TDOC:= @Prompt([OKCANCELLIST]:[NoSort];"Date of Commencement";"Select the documents based on the year of the date of commencement you want to export. Click on [OK] to continue, or click [Cancel] to abandon.";"";TViewList);
@If(TDOC = 1;
@Return(@Prompt([OK];"Error!";"You did not make a selection from the list"));
"");
ENVIRONMENT tDOCMonthYear2 := TDOC;
@Command([ToolsRunMacro];"(Export to Txt Promis v1.2)")
this runs the agent that creates the file, does all the manipulating and exports the file:
Sub Initialize
Dim s As NotesSession
etc..........
msg1 = Msgbox ("Starting Export Process. Please click on [OK] to confirm or [CANCEL] to abandon.",1+64,"Export Start" )
If (msg1= 2) Then
End
End If
Set s = New NotesSession
Set db = s.CurrentDatabase
viewname = s.GetEnvironmentString("$tViewTitle2",True)
Set view = db.GetView(viewname)
Dim TDate As String
TDate = s.GetEnvironmentString("$tDOCMonthYear2",True)
Dim dt As NotesDocumentCollection
Set dt = view.GetAllDocumentsByKey(TDate, False)
Set doc = dt.GetfirstDocument
filename = Inputbox$("Please enter filename where data will be stored (for e.g. C:\filename.txt)", "Filename", "q:\nad786123.txt")
' InputBox[$] ( prompt [ , [ title ] [ , [ default ] [ , xpos , ypos ] ] ] )
If (filename = "") Then
End
End If
Print "Date/Time Export Process Started:" & Str$(Now())
'filename = "C:\exp\testexp.txt"
filenum% = Freefile()
Open filename For Output As filenum%
While Not (doc Is Nothing)
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'these are the fields on each document that I want exported to the spreadsheet
Dim subString1 As String
Dim subString2 As String
'DOB
var1 = Evaluate({@If(CliDoB = "";" ";@Left(@ReplaceSubstring(@Text(CliDoB);"/";"");4) + @Right(@Text(@Date(CliDoB));2))}, doc)
subString1 = var1(0)
'Surname
var2 = Evaluate({CliSurname + @Repeat(" "; 12 - @Length(CliSurname))}, doc)
subString2 = var2(0)
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 'write to file
Print #filenum%, subString1 & subString2
' Set doc = view.GetNextDocument(doc)
Set doc = dt.GetNextDocument(doc)
Wend
Close filenum%
Print "Date/Time Export Process Completed:" & Str$(Now())
Msgbox "Export Process completed successfully.",0+64,"Export Complete"
End Sub
Is it possible to do an export within 2 databases and if so what do i need to add in my code above to make it work.
Your help would be greatly appreciated.
Thanks

Export within 2 databases (Nadeem Shaikh 2.Apr.03)
. . 