Results 1 to 7 of 7

Thread: Exporting VB Text to word

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    10

    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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    10

    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.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    10

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    10

    Re: Exporting VB Text to word

    How do I add a carridge return to have VB do that for word?

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Exporting VB Text to word

    textbox1 & vbnewline & textbox2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width