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 all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Exporting textbox data into MS word (VB.Net)

  • 17-01-2007 8:23pm
    #1
    Registered Users Posts: 1,051 ✭✭✭


    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 Posts: 2,145 ✭✭✭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 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