STick this in a page button initialise eventand try and save, it will come up with a type mismatch error:
Dim ns As New NotesSession
Dim dbUat, dbLive As NotesDatabase
Dim ndc As NotesDocumentCollection
Dim doc As NotesDocument
'Clear current database
Set dbUat = ns.CurrentDatabase
Set ndc = dbUat.AllDocuments
Call ndc.RemoveAll(True)
Set dbLive = ns.GetDatabase("BP1XEULA003", Replace(dbUat.filepath, "/UAT", ""))
If dbLive.isopen Then
Set ndc = dbLive.AllDocuments
Set doc = ndc.GetFirstDocument
While Not(doc Is Nothing)
Call doc.CopyToDatabase(dbUat)
Set doc = ndc.GetNextDocument(doc)
Wend
Print "done"
Else
Print "Failed to open live database"
End If
'curiously if you then
change the
Dim doc As NotesDocument
to
Dim doc, pooh As NotesDocument
or put the dbUat dbLive declarations
on separate line it will compile.
WEIRD - any ideas?