anonymous Log in
Search
Recents:
v3.0
gx-l
Edit a Word document
02/04/21 09:44

nicola

Replies: 1

Good morning, I'm trying to edit a doc or docx document using Genexus. I need to add text and images to an existing document, but all the tools I found are only for java, moreover WordDocument data type is deprecated in gen15 and next. I tried with gen3U15 in a win project, when I click the button I have no errors but nothing happens. Reading from the wiki I think that WordDocument is only for java? Why this? Can I find another way to manage doc?
&sourcePath = "C:/ESTRATTI/Test1.doc"
&sourceTarget = "C:/ESTRATTI/Test2.doc"
&WordDocument.Template = &sourcePath
&WordDocument.Open(&percorso)
&errore = &WordDocument.ErrDescription
&WordDocument.Replace("#RAG#","RTS")
&WordDocument.Save()
&WordDocument.Close()
Nicola Pilli
Sviluppo Software
[virgola25 Midi]
[Descrizione: Descrizione: RTS 1989 Mail]
E nicola@rtsnet.it<mailto:nicola@rtsnet.it>
T 0758010260
F 0758011789
W www.rtsnet.eu<http://www.rtsnet.eu>
==================================================================================
Per favore pensa all'ambiente prima di stampare questa mail (o altro documento)
Please consider the environment before printing this mail (or this document)
==================================================================================
Le informazioni contenute in questa comunicazione e negli allegati sono riservate; è vietato a soggetti diversi dall'effettivo destinatario qualsiasi uso, copia, diffusione di quanto in essi contenuto, sia ai sensi dell'articolo 616 c.p., sia ai sensi e per gli effetti del T.U. sulla privacy (D.lgs 196/2003). Qualora il presente messaggio Vi fosse pervenuto per errore, dovrete provvedere alla sua immediata cancellazione dandocene notizia via e-mail all'indirizzo del mittente o all'indirizzo info@rtsnet.it<mailto:info@angelantoni.it>
This e-mail and any attachment(s) are strictly confidential. This message must not be copied, disclosed or used by anybody other than the intended recipient(s). If you are not the intended recipient(s), please inform the sender by e-mail or send a message to info@rtsnet.it<mailto:info@angelantoni.it> and destroy this message immediately
Replies

msalvatierra

05/04/21 09:04
Nicola, Try this, &sourcePath = "C:\ESTRATTI\Test1.doc" &WordDocument.Open( &sourcePath ) &errore = &WordDocument.ErrDescription &WordDocument.Replace("#RAG#","RTS") &WordDocument.Save() &WordDocument.Close() I 'm assuming that you are running in Windows environment, Do you have Office installed ? Miguel On Fri, Apr 2, 2021 at 10:19 PM Nicola Pilli


Back to gx-l