Bonjour
Je me permets de poster ce message car je suis arrivé à court d'idées afin de résoudre mon problème.
Je souhaite envoyer à un webservice un fichier XML à partir d'une macro WordMac2011. Cette macro fonctionne parfaitement pour WORD (Windows) cependant sur Mac ça ne marche pas.
Voici les quelques lignes de code utilisées pour WORD (Windows) :
Si quelqu'un a une idée d'adaptation de ce code pour MAC je suis preneur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 Dim objXmlhttp As Object Dim objDom As Object Dim strRet Dim isSoapResponse As Boolean Set objXmlhttp = CreateObject("MSXML2.xmlhttp") Set objDom = CreateObject("MSXML2.DOMDocument") objDom.LoadXML strXml 'insert data chunk into XML doc objDom.SelectSingleNode("//bytes").dataType = "bin.base64" objDom.SelectSingleNode("//bytes").nodeTypedValue = dataChunk ' Open the webservice objXmlhttp.Open "POST", ActiveDocument.CustomDocumentProperties("WebServiceURL").Value, False ' Create headings strSoapAction = "http://tempuri.org/UploadFile" objXmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" objXmlhttp.setRequestHeader "SOAPAction", strSoapAction ' Send XML command objXmlhttp.send objDom.XML ' Get all response text from webservice strRet = objXmlhttp.responseText ' Close object Set objXmlhttp = Nothing Set objDom = Nothing 'get the error if any Set objDom = CreateObject("MSXML2.DOMDocument") objDom.LoadXML strRet isSoapResponse = Not (objDom.SelectSingleNode("//soap:Envelope") Is Nothing)
Merci de votre aide
Partager