Exporting VB Text to word
I have a program in word written in the VB editor in it. I have a bunch of text boxes and values that I would like to print out in the word doc.
I'm sure it's pretty simple, but I'm kinda new to this, I have done VB stuff before. How would I get it to print out the text box of what someone enters?
Thanks
Re: Exporting VB Text to word
you can either put the values from the textboxes into a word document, then print that, or print them straight to the printer
printer.print textbox1, textbox2...............
printer.enddoc to tell it thats all and print the page
of course there is much more to it than that if yu want to position it on the page or anything
pete
Re: Exporting VB Text to word
I don't want to print anything.
Add on: I found that if I do ThisDocument.Range.Text = "Hello" & ThisDocument.Range.Text
It screwes up the entire formatting of the doc.
I need to be able to just add 1 page of the VB information to the first of this doc without screwing it all up.
Re: Exporting VB Text to word
you want to add it at the beginning of the document?
maybe you could add a sectionbreak after the vb information
what code do you have so far?
pete
Re: Exporting VB Text to word
I don't really have anything. I have a bunch of forms with text boxes or option boxes and such. Basically the program will do this. Opens up, user enters some info, hits enter, goes to the next form, does it again, and so on and so forth.
So now have textbox1's value is what they entered. I want to be able to spit that out into a word doc.
So be like this
Their Information
Their Information
Their Information
Then
Static Form that is the same for everyone
The problem is if I do ThisDocument.Range.Text = "Hello" & ThisDocument.Range.Text
I screw up the formating of the stuff already in the doc.
Re: Exporting VB Text to word
How do I add a carridge return to have VB do that for word?
Re: Exporting VB Text to word
textbox1 & vbnewline & textbox2