Página de Inicio

LotusScript
Exportar A Word Foros


Un ejemplo de exportacion sacado de los foros del notesring
Hola a todos,

Tengo que crear un documento word a partir de un documento notes, volcando los datos de éste ulltimo. Hasta ahora he conseguido generar el documento word y volcar datos de tipo texto. Lo que no he conseguido es volcar una imagen abierta a ese mismo doc word; esta imagen la he guardado abierta también en Notes, en un campo de texto enriquecido. No sé que sentencia debo usar, parte del código es:


Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim count As Integer
Dim r As Integer
Dim header As String
Dim rows As Integer
Dim wks As New NotesUIworkspace
Dim View As NotesUIView
Set View = wks.currentview

Dim vista As NotesView
Dim vc As NotesViewEntryCollection
Dim entry As NotesViewEntry

'These are Word constants
Const wdAlignParagraphLeft = 0
Const wdAlignParagraphCenter = 1
Const wdAlignParagraphRight = 2

Set db = session.CurrentDatabase
'Set collection = db.AllDocuments

Set View = wks.currentview
Set vista = View.view
Set vc = vista.AllEntries

'count = collection.Count
count=vc.Count
If count = 0 Then
Messagebox "No Documents exist on this view to Export!!"
Exit Sub
End If
'Add one item to the count for the table column headings
rows = count + 1

'The selected Word template is opened from to the user's harddisk.
'Using this template a new Word document is created.
'This document is filled with the correct information, and then saved on the user's harddisk. A table is built within the Word document.
Print"Starting Word, please wait..."
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True

'Opening the template as a new doc

WordApp.Documents.Add("C:\lotus\notes\data\Plantillauniones.doc")

'Create a Word document, and get a handle to it
''''Call wordAppObject.Documents.Add
Set wordDocObject = WordApp.ActiveDocument

'Move the cursor in the Word template where the table will be built
' WordApp.ActiveDocument.Bookmarks("Begin").Select

'Add a table with doc count number of rows and 9 columns
wordDocObject.Paragraphs.Add
Set wordParagraphObject = wordDocObject.Paragraphs(1)
With wordParagraphObject
.Range.Font.Size = 8
.Range.Font.Bold = False
.SpaceAfter = 6
End With
Set wordRangeObject = wordParagraphObject.Range
Set wordTableObject = _
wordDocObject.Tables.Add(wordRangeObject, rows, 9)


'Begin HEADERS formatting here
r=1 'set the cursor to the first row of the table

'Add header to the first cell of the table
Set wordCellObject = wordDocObject.Tables(1).Cell(r,1)
wordCellObject.Column.Width = 50
Set wordParagraphObject = _
wordDocObject.Paragraphs.Add(wordCellObject.Range)
Print "Inserting Issue Number..."
With wordParagraphObject
.Range.Font.Size = 8
.Range.Font.Bold = True
.Range.Text = "Nº Encargo."
.Alignment = wdAlignParagraphCenter
End With

.............


r=1 'set the first row for the addition of entry documents after the headings

For i = 1 To count

r = r+1 'add 1 to row count
'Set doc = collection.GetNthDocument(i)
Set entry = vc.GetNthEntry(i)
Set doc = entry.Document
Msgbox doc.~_encargo(0) + doc.~_nombencargo(0)
'Filling the Word document
'Add data to the first cell of the table
Set wordCellObject = wordDocObject.Tables(1).Cell(r,1)
wordCellObject.Column.Width = 50
Set wordParagraphObject = _
wordDocObject.Paragraphs.Add(wordCellObject.Range)
Print "Inserting Issue Number..."
With wordParagraphObject
.Range.Font.Size = 8
.Range.Font.Bold = False
.Range.Text = doc.~_nencargo(0)
.Alignment = wdAlignParagraphCenter
End With


.....



Next i

WordApp.Activedocument.PrintOut


Set wordAppObject = Nothing
Set wordDocObject = Nothing


Print "Closing Word..."
WordApp.Application.Quit
Print "Closed..."

Set WordApp = Nothing
Print ""
Messagebox "The Word Document was created successfully, Click OK"
Print "Export completed successfully"


Tampoco consigo que me guarde la imagen abierta, me la pone como anexo, y le digo que me lo inserte como objeto: si es un doc de Word sí que lo guarda abierto, sino no...


Muchas gracias por todo

Otros documentos de LotusScript

Extraer Anexos Y Guardar La Última Ruta (Environment)...(08/09/2008 17:35:41)

Tabla De Colores De Letras Cuando Exportamos A Ms Word...(08/09/2008 17:19:13)

Tabla De Colores De Texto Cuando Exportamos A Ms Excell...(08/09/2008 17:18:03)

Nuevo Tipo De Ejecución De Agentes En Lotus Domino R8...(05/09/2008 18:14:26)

Extraer Los Anexos De Cualquier Campo De Un Documento...(04/09/2008 13:39:53)

Exportar A Word 2 Foros(18/02/2008 16:28:50)

Combo Que Se Puede Desplegar (Nsf)(18/02/2008 16:28:50)

Sql Server 2000 Jdbc(18/02/2008 16:28:50)

Cuando El Usuario Entre A Su Buzon De Correo, Se Ejecute Un Proceso...(18/02/2008 16:28:50)

Busqueda De Todas Las Bbdd´S Que Hay En El Servidor. ...(18/02/2008 16:28:50)

Agente Buscar Repetidos(18/02/2008 16:28:50)

Unidades De Red (Fichero Lss)(18/02/2008 16:28:50)

Notes A Access Por Odbc(18/02/2008 16:28:50)

Extraer Informacion De Una Vista (Bd1) A Una Bd Diferentre (Bd2) Y Lle...(18/02/2008 16:28:50)

Envia Un Mail Con Un Fichero Anexado, Que Lo Va A Buscar A Donde Nosot...(18/02/2008 16:28:50)

Modificar Un Campo Comun En Un Conjunto De Formularios...(18/02/2008 16:28:50)

Envio Correo Anónimo(18/02/2008 16:28:50)

Crear Informes En Excel(18/02/2008 16:28:50)

Script De Seguridad (Fichero Lss)(18/02/2008 16:28:50)

Evitar Que Borren Documentos(18/02/2008 16:28:50)

Eliminar Documentos Respuesta Y Respuesta De Respuesta...(18/02/2008 16:28:50)

Como Ordenar Los Resultados De Una Búsqueda(18/02/2008 16:28:50)

Posibilidad De Que El Usuario Realice Una Búsqueda Con Diferentes Pará...(18/02/2008 16:28:50)

Ordenar Listas De Texto Y Numéricas En Lotusscript...(18/02/2008 16:28:50)

Otro Agente Que Puede Ser Interesante.(18/02/2008 16:28:50)

Enviar Un Correo Con Estilo De Párrafo(18/02/2008 16:28:50)

Numeración Automática De Documentos (Queryclose)(18/02/2008 16:28:50)

Exportar A Word Foros(18/02/2008 16:28:50)

Evitar Que Peguen Documentos (Ls)(18/02/2008 16:28:50)

Esto Es Un Codigo Para Acceder (Solamente) A Documentos Personales...(18/02/2008 16:28:49)

Mensaje,Progressbar Y Tokens (3 Ficheros Lss)(18/02/2008 16:28:49)

Exportación De Los Datos De Los Documentos De Una Vista A Un Fichero D...(18/02/2008 16:28:49)

Contestar A Tus Mails Sin Necesidad De Abrir El Propio Mensaje...(18/02/2008 16:28:49)

Abrir Diálogo De Selección De Carpeta Desde Lotusscript...(18/02/2008 16:28:49)

@Replacesubstring Con Lotus Script(18/02/2008 16:28:49)

Exportación A Word(18/02/2008 16:28:49)

Extraer Los Id Del Names Y Eliminarlos(18/02/2008 16:28:49)

Añadir Una Entrada Hijo A Una Entrada De Un Esquema (Outline) Existent...(18/02/2008 16:28:49)

Extraer Anexos Introducidos Desde Web En Un Agente...(18/02/2008 16:28:49)

Exportar Todos Los Anexos De Los Documentos Señalados En Una Vista (Pe...(18/02/2008 16:28:49)

Chequea Todas Las Bases De Datos Locales Y Compacta Aquellas Que Estan...(18/02/2008 16:28:49)

Ubicación Del Directorio Temporal Del Sistema Y Obtención De Un Nombre...(18/02/2008 16:28:49)

Código Para Pasar La Acl De Una Bbdd A Otra(18/02/2008 16:28:49)

Ejemplo Odbc, Conexion A Access(18/02/2008 16:28:49)

Cálculo Del Nif (Corto)(18/02/2008 16:28:49)

Exportar Datos Desde Una Vista A Un Fichero De Excel...(18/02/2008 16:28:49)

Coger Datos De Una Coleccion, Crear Un Documento Y Abrirlo (Charlee)...(18/02/2008 16:28:49)

Posibilidad De Ejecutar Agentes Del Servidor Desde Un Cliente, Pasándo...(18/02/2008 16:28:49)

Cálculo Nif (Largo)(18/02/2008 16:28:49)

Eliminar Una Entrada De Un Esquema (Outline) Existente....(18/02/2008 16:28:49)

Codigo Editar Y Guardar Todos Los Documentos De Una Bbdd...(18/02/2008 16:28:49)

Calculo Del Iva(18/02/2008 16:28:49)

Renombrar Una Vista. (18/02/2008 16:28:49)



Web Desarrollada por Juan Carlos Trigo Díaz
Optimizado para: 1024 x 768 pixels - Explorer > 6 Copyright © 2008