Hola a todos,
estoy creando una macro, que se ejecuta desde un documento Word. Dicha macro
crea un documento nuevo basado en una plantilla, e inserta una tabla. He
conseguido modificar la primera fila, pero cuando quiero empezar a meter
datos en las celdas de la segunda fila, me da un error de propiedad o
método. A continuación pongo el código.
¿Alguien puede darme alguna pista?
Gracias y un saludo.
Set docCertificado = Documents.Add("C:miplantilla.dot")
Selection.GoTo What:=wdGoToBookmark, Name:="InicioTablas"
'Añado la tabla y configuro la primera celda
docCertificado.Tables.Add Range:=Word.Selection.Range, numrows:=4,
numcolumns:=3
Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Cells.Merge
With Selection
.Text = "Serie"
.Font.Name = "Arial"
.Font.Size = 10
.Font.Bold = True
.Font.Color = wdColorWhite
.Shading.BackgroundPatternColor = wdColorDarkRed
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
Selection.SelectCell
'Segunda fila de la tabla
With docCertificado.Tables(1).Cells(1,2).Range AQUÍ ES DONDE ME DA EL
ERROR
.Text = "Texto en primera celda, segunda fila"
.Font.Name = "Arial"
.Font.Size = 10
.Font.Bold = True
.Font.Color = wdColorWhite
.Shading.BackgroundPatternColor = wdColorDarkRed
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
Leer las respuestas