NRDigital Junio 2013

Page 51

TRUCOS / Exportando a MS Word 2010 desde Lotus Notes 8.5 ‘--------------- Mostramos la ventana de Word -------------- WordApp.Visible = True ‘---------- Creamos el documento de Word y quitamos los margenes ----------’ WordApp.Documents.Add WordApp.ActiveDocument.PageSetup.TopMargin = 0 WordApp.ActiveDocument.PageSetup.BottomMargin = 0 WordApp.ActiveDocument.PageSetup.LeftMargin = 0 WordApp.ActiveDocument.PageSetup.RightMargin = 0 ‘--------- Creamos la tabla para insertar las etiquetas o campos -------- Set docu = WordApp.ActiveDocument ‘--------- alineación vertical del texto (izquierda = 0 , centrada = 1, derecha = 2) ---------’ ‘-----WordApp.Selection.Cells.VerticalAlignment = 1 ‘-------- establecemos la sangria (izquierda y derecha) ------- WordApp.Selection.ParagraphFormat.LeftIndent = 20 WordApp.Selection.ParagraphFormat.RightIndent = 20 ‘-------alineación horizontal del texto (izquierda = 0 , centrada = 1, derecha = 2, justificado = 3)-------’ WordApp.Selection.ParagraphFormat.Alignment = 0 ‘-------- definimos el estilo de fuente (fuente, tamaño, estilo) --------’ WordApp.Selection.Font.Bold = False WordApp.Selection.Font.Name = “Verdana” WordApp.Selection.Font.Size = 7 ‘---------------------- Definimos e iniciamos variables necesarias las etiquetas ----------------------’ ‘------Agrege ndcol y tabla y tambien i------’ Dim ndcol, i As Integer ndcol= 0 ‘--------------------------------- Exportación ---------------------------------’ Print “- Creando las etiquetas o campos, por favor espere... -” Set nd = view.GetFirstDocument ndcol = view.entrycount For i =1 To ndcol WordApp.Selection.TypeParagraph WordApp.Selection.TypeText(“nombre: “) WordApp.Selection.TypeText(nd.nombres(0)) WordApp.Selection.TypeText(“ “) WordApp.Selection.TypeText(nd.apellidos(0)) WordApp.Selection.TypeText(“ “) WordApp.Selection.TypeText(“email: “) WordApp.Selection.TypeText(nd.correoelectronico(0)) WordApp.Selection.TypeParagraph Set nd = view.GetNextDocument(nd) ‘-------- Movemos el cursor un tabulador atrás para quitar la selección --------’ WordApp.Selection.MoveLeft 1 Next Print “- Terminado el proceso de creación de etiquetas... -” End Sub

Luego guardamos todo y regresamos la vista que creamos en el paso número 5. NR DIGITAL | 51


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.