Jump to content

Print .xml object using vbscript


mail.h.shukla

Recommended Posts

Thought of using JavaScript? Then you get access to the wonderful XMLHttpRequestObject() (which along with the XML DOM and .print() will solve all your problems :) )

Link to comment
Share on other sites

Thought of using JavaScript? Then you get access to the wonderful XMLHttpRequestObject() (which along with the XML DOM and .print() will solve all your problems :) )
May be that it can help. But my existing project is in vbscript.And I need to do the same in vbscript only...Please help me if you know a way there in vbscript also. :)
Link to comment
Share on other sites

Looks like you can use the ActiveX controlhttp://msdn2.microsoft.com/en-us/magazine/cc301512.aspxBut it won't work in non-IE browsers. Doesn't VBScript only work in IE anyway though?
Hey buddy,You acted just like a got to me.I will go through the document you provided to me, and let you know if my problem is solved or not.BTW, mine application is purely vbscript application and it cannot work on non IE browsers.Any other sugession is also welcome.Thanks a lot.
Link to comment
Share on other sites

Looks like you can use the ActiveX controlhttp://msdn2.microsoft.com/en-us/magazine/cc301512.aspxBut it won't work in non-IE browsers. Doesn't VBScript only work in IE anyway though?
Hello boss,The link sent by you is really useful, but this task is already done by me today itself.I have got the object of the required xml with me. I am able to retreive any of the data of xml using this object.Still my problem is not solved yet.I want to print this job/object on the "PRINTER".Can i use "debug.print " for this option? If yes, please tell me how?Please help me.
Link to comment
Share on other sites

Hi all,I want to add some more things to this forum.The application which my client is using requires a VBScript method to be called.Only an xml file is provided to vbscript.And I have to automate the printing form our client's web page.Again I have to mention, I have to use "only and only VBScript".I have written some codes.Let me provide that code to you.This particular code is fetching the data from xml file. It is formatting the data in a tabular format. And the calling the print method.But..... even after displaying full details of the xml file in an html page(tabular format), it is printing a blank page... As I know, "window.print()" method prints the current page. But it is not printing....The code is: Sub DisplayXml set objXML = CreateObject("Microsoft.XMLDOM") set objLst = CreateObject("Microsoft.XMLDOM") objXML.async = false objXML.Load("C:\Log\autoplay.xml") set objLst = objXML.getElementsByTagName("*") document.write("<table id=t1 cellspacing=1 cellpadding=1 border=1>") ' Delete the current order Details for i=2 to document.all.t1.rows.length document.all.t1.deleteRow() next j=1 for i = 2 to (objLst.length - 1) if j = 1 then set trow = document.createElement ("tr") set trow = t1.insertRow() end if set tcol = document.createElement ("td") set tcol = trow.insertCell() tcol.innerHTML = objLst.item(i).text if j = 6 then j = 1 else j = j + 1 end if next document.write("</table>") MsgBox "Table Completed" window.print() End SubPlease help me finding the error...I think, as this is a dynamic html page, it is creating problem.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...