Я бы хотел скопировать форму из одного NSF в другой NSF программно.Мне известно, что класс NotesDocument имеет метод CopyToDatabase, а класс NotesDatabase имеет метод CreateView.
Однако я не нашел ничего, что позволило бы мне добавить форму в NSF.
Я использую Lotus Notes 8.5.2, COM и C #.
У меня нет проблем с получением информации о формах или их удалением, и у меня есть следующий фрагмент кода:
//NotesConnectionDatabase and nd2 are objects of type NotesDatabase and are
//members of the same session.
//Write the name of each form to the console.
//Delete each form from the database.
for (int i = 0; i <= (((object[])NotesConnectionDatabase.Forms)).Length - 1; i++)
{
Console.WriteLine(((NotesForm)((object[])NotesConnectionDatabase.Forms)[i]).Name);
((NotesForm)((object[])NotesConnectionDatabase.Forms)[i]).Remove();
}
//For each form in nd2, copy the form to NotesConnectionDatabase.
for (int j = 0; j <= (((object[])nd2.Forms)).Length - 1; j++)
{
//I am aware that there is no such method as NotesForm.CopyToDatabase
((NotesForm)((object[])nd2.Forms)[j]).CopyToDatabase(NotesConnectionDatabase);
}