Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Exporting textbox data into MS word (VB.Net)

  • 17-01-2007 7:23pm
    #1
    Registered Users, Registered Users 2 Posts: 1,055 ✭✭✭


    Is it possible to take information from text boxes in a vb form and place them in specific places on a prepared MS word document?

    I have a form which is taking details of an order (Product, Price, Quantity Totals) and I want to export this information into a word doc that has already been prepared with a logo. The document would be a invoice.

    Just wondering is it actually possible because the searching I have done so far on Google is turning up results of exporting Crystal Reports to MS word.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,152 ✭✭✭dazberry


    I have done this before twice, both in Delphi using two different methods.

    1. COM, Clipboard, RTF segments and parsing
    Using COM I started Word, created a new document, and wrote out a few characters to the document. I cut the document to the clipboard and got the clipboard data type. Then I loaded up the relevent RTF segments in the application, parsed the variables in the RTF segments in memory, put the resulting segments back into the clipboard, and had Word paste them back into itself.

    2. COM, Mailmerge
    Had over 100 template letters with data coming from a Unix system. When I'd detect a new data file, using COM I'd start Word, load the template (which had mailmerge information) specifying the data file. Word would generate the letter and then using some trickery (changing printers, specifying printer trays etc) get Word to either print out the letters or print them to disk (for further FTPing to remote printers). I don't know if it is Word thing, a load thing of just the box they gave be but its a bit flakey.

    HTH

    D.


  • Registered Users, Registered Users 2 Posts: 1,456 ✭✭✭FSL


    Yes it's quite simple. In Vbasic open the word document template, fill the fields in the template with the date from the VB Form then save the form as as a new document, or print it, or email it, or if you have fax software fax it,


Advertisement