RE:INSERTAR CAMPOS DE UNA TABLA FOX A WORD..
Te pasoun ejemplo que tengo, solo borra las lineas de codigo que no te sirve
PROCEDURE exportToWord_ar
#DEFINE lEnter CHR(13)
#DEFINE lTab CHR(9)
#DEFINE lSaltoPag CHR(12)
mPath = mPathAux + 'Presup_Neg_' + ALLT(STR(mFicha))
&& Recorto las Lineas de Separación
WAIT "Generando Presupuesto..." WIND NOWAIT
SELE todojun
GO TOP
DO WHILE !EOF()
IF RECNO() > 1
IF !EMPTY(SERVICIO)
SKIP -1
REPLACE DESCRIP WITH REPLICATE('_',93)
SKIP
ENDIF
IF ALLT(SERVICIO) = 'PAX'
IF mvalores
SKIP -5
REPLACE DESCRIP WITH REPLICATE('_',93)
SKIP 5
ELSE
SKIP -2
REPLACE DESCRIP WITH ''
SKIP 2
ENDIF
ENDIF
ENDIF
SKIP
ENDDO
lalias = ALIAS()
larchivo = 'A'+SYS(3)
CREATE CURSOR larchivo (imagen M)
APPE BLANK
APPE MEMO imagen FROM logofalabella.gif
COPY MEMO larchivo.imagen TO mPathAux + "logofalabella.gif"
APPE BLANK
APPE MEMO imagen FROM firma_presupuestos.bmp
COPY MEMO larchivo.imagen TO mPathAux + "firma_presupuestos.bmp"
SELECT &lalias
oWord=CreateObject("Word.Application")
WITH oWord
* .Visible=.T.
.Documents.Add
&& Seteos de Tipo de Hoja Carta
WITH oWord.ActiveDocument.PageSetup
*.LineNumbering.Active = 0
*.Orientation = 0
.TopMargin = 22
.BottomMargin = 22
.LeftMargin = 28
.RightMargin = 22
*.Gutter = 0
.HeaderDistance = 22
.FooterDistance = 22
.PageWidth = 612.1
.PageHeight = 792.1
*.FirstPageTray = 0
*.OtherPagesTray = 0
.SectionStart = 2
*.OddAndEvenPagesHeaderFooter = 0
*.DifferentFirstPageHeaderFooter = 0
*.VerticalAlignment = 0
*.SuppressEndnotes = 0
*.MirrorMargins = 0
*.TwoPagesOnOne = 0
*.GutterPos = 0
ENDWITH
oword.ActiveWindow.ActivePane.View.SeekView = 9 && wdSeekCurrentPageHeader
.Selection.MoveRight
.Selection.InlineShapes.AddPicture(mPathAux + "logofalabella.gif")
.Selection.MoveRight
.Selection.InsertAfter(space(8))
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 14
.Selection.Font.Bold = 1
.Selection.Font.Underline = 0
.Selection.ParagraphFormat.Alignment = 0
.Selection.MoveRight
.Selection.InsertAfter(mtitulo)
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 14
.Selection.Font.Bold = 1
.Selection.Font.Underline = 1
.Selection.ParagraphFormat.Alignment = 0
if msubtitulo
.Selection.MoveRight
.Selection.TypeParagraph
.Selection.InsertAfter(mtitulo1)
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 12
.Selection.Font.Bold = 1
.Selection.Font.Underline = 1
.Selection.ParagraphFormat.Alignment = 1
endif
oword.ActiveWindow.ActivePane.View.SeekView = 0 && wdSeekMainDocument
if msubtitulo
.Selection.MoveRight
.Selection.TypeParagraph
.Selection.InsertAfter('Operador Responsable :')
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 10
.Selection.Font.Bold = 1
.Selection.ParagraphFormat.Alignment = 0
endif
.Selection.Moveright
.Selection.TypeParagraph
.Selection.InsertAfter('Negocio : ' + ALLTRIM(STR(mFicha)) + space(31-len(ALLTRIM(STR(mFicha)))) + 'Vendedor: '+ mNomVendedor + space(27-len(mNomVendedor)) + 'Fecha: '+dtoc(date()))
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 10
.Selection.Font.Bold = 1
.Selection.Font.Underline = 0
.Selection.ParagraphFormat.Alignment = 0
.Selection.Moveright
.Selection.TypeParagraph
.Selection.InsertAfter('Pasajero: ' + UPPER(ALLTRIM(mpasajero)) + space(31-len(ALLTRIM(mpasajero))) + 'Teléfono: ')
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 10
.Selection.Font.Bold = 1
.Selection.Font.Underline = 0
.Selection.ParagraphFormat.Alignment = 0
.Selection.Moveright
.Selection.TypeParagraph
.Selection.InsertAfter('Sucursal: ' + ALLTRIM(mNomSucursal) + space(31-len(ALLTRIM(mNomSucursal))) + 'Horario : ')
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 10
.Selection.Font.Bold = 1
.Selection.ParagraphFormat.Alignment = 0
.Selection.Font.Underline = 0
.Selection.Moveright
.Selection.TypeParagraph
.Selection.InsertAfter(replicate('_',77))
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 12
.Selection.Font.Bold = 1
.Selection.ParagraphFormat.Alignment = 0
.Selection.Font.Underline = 0
.Selection.EndKey
.Selection.MoveDown
.Selection.TypeParagraph
.Selection.Font.Bold = 0
.Selection.ParagraphFormat.Alignment = 0
lEspacio = REPLICATE(lEnter,1)
.Selection.InsertAfter(lEspacio)
SCAN
.Selection.InsertAfter(DESCRIP)
.Selection.Font.Name = "Courier New"
.Selection.Font.Size = 10
.Selection.Font.Underline = 0
IF (AT('Pasajero',descrip)>0 and ;
AT('Documento',descrip)>0 and ;
AT('Telefono',descrip)>0 and ;
AT('Nacionalidad',descrip)>0 and ;
AT('Fecha Nac.',descrip)>0);
.or. at('NOMINA',descrip)>0
.Selection.Font.Bold = 1
ELSE
.Selection.Font.Bold = 0
ENDIF
.Selection.Moveright
.Selection.TypeParagraph
ENDSCAN
if mpie
oword.ActiveWindow.ActivePane.View.SeekView = 10 &&wdSeekCurrentPageFooter
.Selection.MoveRight
.Selection.InlineShapes.AddPicture(mPathAux + "firma_presupuestos.bmp")
oword.ActiveWindow.ActivePane.View.SeekView = 0 && wdSeekMainDocument
endif
&& Guardo el Archivo
IF FILE(mPath) && si existe el archivo, lo sobreescribo
DELE FILE (mPath)
.ActiveDocument.SaveAs(mPath)
ELSE
.ActiveDocument.SaveAs(mPath)
ENDIF
.Quit
WAIT CLEAR
ENDWITH
aviso('Se ha Generado el Archivo: ' + mPath,1)
RELEASE oWord