How can I print a XML file
Hi vb-forum:
I need some help, I know that you always have a solution; I need to print the content of a .xml file, does anybody how can I do it?, or if someone know an example code to print this kind of files?
Thank in advance and regards.
Angel Maldonado
VB Developer
Re: How can I print a XML file
And XML File is basically a text file with certain variable parameters and their values inserted side by side... so you can print it like a normal text file in VB using the Rich Text Box control and opening the XML file and using Printer.Print RichTextBox1.Text
Re: How can I print a XML file
What would you need to import it into a richtextbox first? Just send it straight to the printer like any other text file.
VB Code:
Option Explicit
Private Function PrintTextFile(sTextFile As String) As String
If Dir(sTextFile) <> vbNullString Then
Open sTextFile For Binary As #1
PrintTextFile = Input(LOF(1), 1)
Close #1
End If
End Function
Private Sub Command1_Click()
Screen.MousePointer = vbHourglass
Printer.Print PrintTextFile("d:\closedhow.xml")
Printer.EndDoc
Screen.MousePointer = vbDefault
End Sub
Re: How can I print a XML file
Ok:
I need to make a format to extract and print this values or parameters that has some envoice files on .xml format, i.e. name, address, zip code, etc. if you know some process that made a print preview I glad you, taken this values I can print the report of envoices.
Thanks and have a nice day.
Angel M.
Re: How can I print a XML file
You mean in the format eg:
Name: Jon Doe
Address: Al Ovah
Zip: 1234
Cause if this is how you want to do it then you'll need to parse the XML file...
Re: How can I print a XML file
Yes Protocol, I need to make a format like this, Hack I'm going to test the code.
Re: How can I print a XML file
Send it to IE (or any browser than can display XML) and print it from there.