PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → objet Automation "word.Application"
objet Automation "word.Application"
Iniciado por Jean-Michel, 05,nov. 2018 16:05 - 3 respuestas
Miembro registrado
856 mensajes
Publicado el 05,noviembre 2018 - 16:05
Comment sauvegarder un fichier Word .doc en .docx en utilisant "objet Automation" ?


Word est un objet automation dynamique
Word = allouer un objet automation "word.Application"
Word>>Visible = Faux

CheminModele = "c:\MonFichier.doc"
Word>>Documents>>Open(CheminModele)

// Peut être une solution:
// Comment placer : FileFormat:=wdFormatDocument ?

CheminDestination = "c:\MonFichier.docx"
Word>>ActiveDocument>>SaveAs(CheminDestination,0)

Word>>ActiveDocument>>Close
Word>>quit


--
Synchronize Systems International LTD
Développement d'outils de gestion

Environnements AS400 – Windows
Langages GAP III – CL – Visual Basic - Visual Adélia - Adélia - Windev
http://www.cashpower.fr/

Bangkok / Pattaya
Miembro registrado
962 mensajes
Publicado el 06,noviembre 2018 - 00:16
hello,
c'est le deuxième paramètre du SaveAs qui te donne le format de sauvegarde (wdSaveFormat) :
wdFormatDocument 0 Microsoft Word format.
wdFormatDocument97 0 Microsoft Word 97 document format.
wdFormatDocumentDefault 16 Word default document file format. For Microsoft Office Word 2007, this is the DOCX format.
wdFormatDOSText 4 Microsoft DOS text format.
wdFormatDOSTextLineBreaks 5 Microsoft DOS text with line breaks preserved.
wdFormatEncodedText 7 Encoded text format.
wdFormatFilteredHTML 10 Filtered HTML format.
wdFormatFlatXML 19 Reserved for internal use.
wdFormatFlatXMLMacroEnabled 20 Reserved for internal use.
wdFormatFlatXMLTemplate 21 Reserved for internal use.
wdFormatFlatXMLTemplateMacroEnabled 22 Reserved for internal use.
wdFormatHTML 8 Standard HTML format.
wdFormatOpenDocumentText 23
wdFormatPDF 17 PDF format.
wdFormatRTF 6 Rich text format (RTF).
wdFormatStrictOpenXMLDocument 24 Strict Open XML document format.
wdFormatTemplate 1 Microsoft Word template format.
wdFormatTemplate97 1 Word 97 template format.
wdFormatText 2 Microsoft Windows text format.
wdFormatTextLineBreaks 3 Microsoft Windows text format with line breaks preserved.
wdFormatUnicodeText 7 Unicode text format.
wdFormatWebArchive 9 Web archive format.
wdFormatXML 11 Extensible Markup Language (XML) format.
wdFormatXMLDocument 12 XML document format.
wdFormatXMLDocumentMacroEnabled 13 XML template format with macros enabled.
wdFormatXMLTemplate 14 XML template format.
wdFormatXMLTemplateMacroEnabled 15 XML template format with macros enabled.
wdFormatXPS 18 XPS format.


Donc à priori il te faudrait mettre 16.

--
Ami calmant, J.P
Mensaje modificado, 06,noviembre 2018 - 00:18
Miembro registrado
856 mensajes
Publicado el 06,noviembre 2018 - 07:27
Salut Jurassic !!
Comment va, plaisir de te lire.

J'ai trouvé apres ici : https://docs.microsoft.com/en-us/office/vba/api/word.wdsaveformat
Grand merci MAIS je pense que tu peux m'aider sur les tableaux traitement texte Windev.
J'ai mis un sujet qui est actuellement à la page 3 : https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/221639-champs-traitement-texte/read.awp
Titre : "Champs Traitement de texte"
Je suis sûre que toi, tu sais !!

Merci à toi.
J.Michel

--
Synchronize Systems International LTD
Développement d'outils de gestion

Environnements AS400 – Windows
Langages GAP III – CL – Visual Basic - Visual Adélia - Adélia - Windev
http://www.cashpower.fr/

Bangkok / Pattaya
Miembro registrado
962 mensajes
Publicado el 06,noviembre 2018 - 17:48
hello,
désolé mais je suis resté à la version jurassique de windev N° 16 donc je ne connais pas le champ Traitement de texte.

--
Ami calmant, J.P