Sub Click(Source As Button)
Dim xlFilename As String
xlFilename = Inputbox$("Файл импорта по умолчанию.", "Файл для импорта Диск:\f2.XLS", "c:\1.xls")
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Dim row As Integer
Dim written As Integer
Dim Excel As Variant
Dim xlWorkbook As Variant
Dim xlSheet As Variant
Dim xlCells As Variant
Set Excel = CreateObject("excel.application")
Excel.Visible = False
Print "Открыт файл " & xlFilename & "..."
Excel.Workbooks.Open xlFilename '// открытие файла Excel
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
Set xlCells = xlSheet.Cells
Print "Starting import from Excel file..."
Dim strName As String
Add:
Set doc = db.CreateDocument
With doc
.Form = "Сотрудник1"
.CompanyName = xlCells( 5, 2).Value
.Department = xlCells( 6, 2).Value
.Manager = xlCells( 7, 2).Value
.LastName = xlCells(10, 2).Value
.FirstName = xlCells( 11, 2 ).Value
.MiddleInitial = xlCells(12, 2).Value
.dsp_LotusName = xlCells(13, 2).Value
.OfficePhoneNumber = xlCells( 23, 2 ).Value
.OfficeFAXPhoneNumberl = xlCells(24, 2).Value
.CellPhoneNumber = xlCells( 25, 4).Value
.PhoneNumber = xlCells(26, 3).Value
.PhoneNumber_6 = xlCells( 27, 4).Value
.CompanyName = xlCells( 5, 2).Value
.Department = xlCells( 6, 2).Value
.JobTitle = xlCells(4, 6).Value
.MailAddress = xlCells(29, 3).Value
.WebSite = xlCells( 30, 4).Value
End With
Call doc.Save( True, True )
Set doc = Nothing
excel.quit
Dim ws As New NotesUIWorkspace
Call ws.ViewRefresh
End Sub