Está en la página 1de 2

http://free.corefusion.net/Free/hugosoft/home.

nsf/lotusscript10/86162CD6E2E300CA
852571A800684732?OpenDocument
te copio el cdigo:
Dim xlFilename As String
xlFilename = "c:\archivo.xls" 'archivo que vamos a importar
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument(db)
Dim One As String
Dim row As Integer
Dim written As Integer
filas=Inputbox("Teclea el nmero de filas","Introduccin de No. de Filas",10)
If filas="" Then
Exit Sub
End If
Dim Excel As Variant
Dim xlWorkbook As Variant
Dim xlSheet As Variant
Print "Connecting to Excel..."
Set Excel = CreateObject( "Excel.Application" )
Excel.Visible = False 'No mostramos la ventana de Excel
Print "Opening " & xlFilename & "..."
Excel.Workbooks.Open xlFilename 'Abrimos el fichero de Excel
Set xlWorkbook = Excel.ActiveWorkbook
Set xlSheet = xlWorkbook.ActiveSheet
Goto Records
Print "Disconnecting from Excel..."
xlWorkbook.Close False 'Cerramos la hoja de Excel sin guardar cambios
Excel.Quit 'Cerramos Excel
Set Excel = Nothing ' Liberamos la memoria que hemos utilizado
Print " " 'Limpiamos la linea de estado
Records:
row = 0 'ponemos a 0 las variables
written = 0
Print "Comenzando la importacin del fichero de Excel..."
Do While True
Finish:
With xlSheet
filas=filas+writen
row = row + 1
Set view = db.GetView("Vista") ' Nombre de la vista
Set doc = db.CreateDocument '// Creamos un nuevo documento
doc.Form = "Form" Forma que se tomara para crear documentos
doc.campo_de_la_form1 = .Cells( row, 1 ).Value
doc.campo_de_la_form2 = .Cells(row, 2 ).Value
doc.campo_de_la_form3 = .Cells(row, 3).Value
Call doc.Save( True, True ) ' Guardamos el documento
written = written + 1
If written = filas Then
Goto Done
End If
End With
Loop
Return
Done:
Msgbox "Documentos creados:" & written

También podría gustarte