Hola.... Necesito ayuda para poder hacer que los datos de una tabla dbf de Visual fox se pasen a un archivo de word. Si alguien puede ayudarme, mil gracias. Saludos
1 Respuesta
Respuesta de junio0or
1
1
junio0or, Hola ... Estudio Ingenieria en Sistemas, con experiencia en...
Lcdir = Addbs(Getenv("TEMP")) Lcwordname = Lcdir + 'Informe Division De Comunicacion Corporativa' Declare Integer CloseClipboard In user32 Declare Integer OpenClipboard In user32 Integer Declare Integer GetClipboardData In user32 Integer Declare Integer IsClipboardFormatAvailable In user32 Integer Declare Integer GetObjectType In gdi32 Integer Local Loword As "WORD.APPLICATION" Local Lnwindow, Lcpath, Lcdoc Lcdoc = Lcwordname Declare Integer SetForegroundWindow In Win32API Long Declare Long FindWindow In Win32API String, String Try Loword = Getobject(, "WORD.APPLICATION") Catch To Loerr When Loerr.Errorno = 1426 Loword = Createobject("WORD.APPLICATION") Finally Endtry If Type('loWord.ActiveDocument') = 'O' Loword.Activedocument.Close Endif Lnwindow = Findwindow(.NULL., Loword.Name) If !Empty(Lcdoc) Lcdoc = Lower(Forceext(Alltrim(Lcdoc), 'DOC')) If File(Lcdoc) Lcdoc = Fullpath(Lcdoc) Loword.Documents.Open(Lcdoc) Else Loword.Documents.Add("Normal", .F., 0) Lcpath = Justpath(Lcdoc) If !Directory(Lcpath) Md (Lcpath) Endif Loword. Activedocument. Saveas(Lcdoc) Endif Endif Loword.Visible = .T. If Lnwindow <> 0 Setforegroundwindow(Lnwindow) Endif For Imagenes_s = 1 To 8 Do Case Case Imagenes_s = 1 Lochart = thisform.Foxcharts3 Case Imagenes_s = 2 Lochart = thisform.Foxcharts7 Case Imagenes_s = 3 Lochart = thisform.Foxcharts1 Case Imagenes_s = 4 Lochart = thisform.Foxcharts5 Case Imagenes_s = 5 Lochart = thisform.Foxcharts6 Case Imagenes_s = 6 Lochart = thisform.Foxcharts2 Case Imagenes_s = 7 Lochart = thisform.Foxcharts8 Case Imagenes_s = 8 Lochart = thisform.Foxcharts4 Endcase Lochart.Obmp.Toclipboard() = Openclipboard(0) = Closeclipboard() With Loword Hclipbmp = Getclipboarddata(2) Lcfile = Addbs(Getenv('temp')) + Sys(2015) + ".PNG" Lochart. Savetofile(Lcfile) .Selection.Inlineshapes.Addpicture(Lcfile, .F., .T.) Endwith Endfor Erase (Lcfile) Saludos, espero que te sirva sino mandame tus campos como te dije saludos