|
-
Dec 20th, 2005, 10:21 AM
#1
Thread Starter
Lively Member
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
Angel Maldonado López.
VB Programmer
-
Dec 20th, 2005, 10:43 AM
#2
Hyperactive Member
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
If my post has been helpful, then please rate it accordingly...
If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.
-
Dec 20th, 2005, 10:51 AM
#3
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
-
Dec 20th, 2005, 11:11 AM
#4
Thread Starter
Lively Member
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.
Angel Maldonado López.
VB Programmer
-
Dec 20th, 2005, 11:20 AM
#5
Hyperactive Member
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...
If my post has been helpful, then please rate it accordingly...
If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.
-
Dec 20th, 2005, 11:30 AM
#6
Thread Starter
Lively Member
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.
Angel Maldonado López.
VB Programmer
-
Dec 20th, 2005, 11:52 AM
#7
Hyperactive Member
Re: How can I print a XML file
Send it to IE (or any browser than can display XML) and print it from there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|