Automatización VFP: word
Publicado por Ana (15 intervenciones) el 14/05/2009 03:00:03
He creado un archivo en word e incorporado una tabla, pero no puedo centrar los datos que tengo en la primera fila (que es el encabezado).
Por favor si alguien tiene idea, les agradezco de antemano.
Saludos,
oWord.ActiveDocument.Tables.Add(oRange, xfilas+1, 6, 1, 0) && Word 2000 syntax
oTable = oWord.ActiveDocument.Tables(1) && Assign a table object
with oTable
.Rows.WrapAroundText = .T.
.Rows.RelativeHorizontalPosition = 0 .Rows.HorizontalPosition = -999996 && wdTableRight
.Columns(1).PreferredWidth = 80
.Columns(2).PreferredWidth = 80
.Columns(3).PreferredWidth = 80
.Columns(4).PreferredWidth = 80
.Columns(5).PreferredWidth = 80
.Columns(6).PreferredWidth = 80
oRange.Collapse(wdCollapseStart)
.Cell(1,1).Range.InsertAfter("LUN")
.Cell(1,2).Range.InsertAfter("MAR")
.Cell(1,3).Range.InsertAfter("MIE")
.Cell(1,4).Range.InsertAfter("JUE")
.Cell(1,5).Range.InsertAfter("VIE")
.Cell(1,6).Range.InsertAfter("SAB")
*/* Pone todos los títulos en negrita y en font 10
for n_bold = 1 to 6
.Cell(1,n_bold).Range.Font.Bold = .t. .Cell(1,n_bold).Range.Font.Size = 10
next
oRange.Collapse(wdCollapseEnd)
endwith
Por favor si alguien tiene idea, les agradezco de antemano.
Saludos,
oWord.ActiveDocument.Tables.Add(oRange, xfilas+1, 6, 1, 0) && Word 2000 syntax
oTable = oWord.ActiveDocument.Tables(1) && Assign a table object
with oTable
.Rows.WrapAroundText = .T.
.Rows.RelativeHorizontalPosition = 0 .Rows.HorizontalPosition = -999996 && wdTableRight
.Columns(1).PreferredWidth = 80
.Columns(2).PreferredWidth = 80
.Columns(3).PreferredWidth = 80
.Columns(4).PreferredWidth = 80
.Columns(5).PreferredWidth = 80
.Columns(6).PreferredWidth = 80
oRange.Collapse(wdCollapseStart)
.Cell(1,1).Range.InsertAfter("LUN")
.Cell(1,2).Range.InsertAfter("MAR")
.Cell(1,3).Range.InsertAfter("MIE")
.Cell(1,4).Range.InsertAfter("JUE")
.Cell(1,5).Range.InsertAfter("VIE")
.Cell(1,6).Range.InsertAfter("SAB")
*/* Pone todos los títulos en negrita y en font 10
for n_bold = 1 to 6
.Cell(1,n_bold).Range.Font.Bold = .t. .Cell(1,n_bold).Range.Font.Size = 10
next
oRange.Collapse(wdCollapseEnd)
endwith
Valora esta pregunta


0