Voici ci dessous un bout de code qui génère un fichier XML à partir d'un document. tout fonctionne bien, mais j'aurai voulu changer l'encodage (1ère ligne du fichier généré) :
<?xml version='1.0' encoding='utf-8'?>
Comment puis je faire pour changer l'utf-8 en CP1252 ?
Merci pour votre aide.
Christophe
- Code : Tout sélectionner
'Create an XML exporter tool.
Set Exporter = Sess.CreateDxlExporter
Exporter.OutputDOCTYPE = False
'Create an output stream that will receive XML.
Set Stream = Sess.CreateStream
'Attach the stream as the output of the XML exporter.
Call Exporter.SetOutput (Stream)
'Create the name of the XML output file.
XmlFilePath = XML_OUTPUT_DIR +"\"+Strtoken(thisDb.FileName,".",1)+ "\"+NoteID+XML_OUTPUT_SUFFIX
'Make this document the input to the XML exporter.
Call Exporter.SetInput (Onedoc)
'Associate the XML output stream with the output file.
Call Stream.Open(XmlFilePath )
'Translate the doc into XML.
Call Exporter.Process