- Code: Select all Expand view RUN
Function stampa_affidamento()
Local cdoc:= "c:\maga\affida.doc"
oWord = TOleAuto():New( "Word.Application" )
oDoc = oWord:Documents:Open( cDoc )
oDoc:Select()
oSel = oWord:Selection
WORDREPLACE( oSel, "<protocollo>", (oDCom)->NumDoc )
WORDREPLACE( oSel, "<data>", DToC((oDCom)->FecDoc) )
WORDREPLACE( oSel, "<fornitore>", (oDCom)->RazSoc )
WORDREPLACE( oSel, "<servizio>", (oDCom)->Concep )
WORDREPLACE( oSel, "<costo>", Desp_Imp() )
// vederla in video e modificarla e salvarla
oDoc:save("c:\maga\aff_"+(oDCom)->NumDoc+".doc")
*oDoc:save("c:\maga\aff_"+alltrim((oDCom)->RazSoc)+"_"+(oDCom)->NumDoc+"_"+dtos(date())+".doc")
oWord:Visible=.t.
//stampa
*oDoc:PrintOut( .F. )
*oDoc:Close( 0 )
*oWord:Quit()
return nil
it create a doc and replace variables but i make some error and the create the doc with xp wwinord 2003
Why ?
On win 2000 ( office 2000) run ok