Printing labels from vb.net
Posted on 2007-04-10
I would like to print labels from a .net form. I have looked at the possibility of printing directly from vb.net or sending data to Word and printing from there. I see there may be a few ways of putting the data into Word and have experimented with using a Word.XML template type file with some success. I'm looking at replacing text in ordinary Word file now. I haven't worked out how to do this without opening and closing the file for every print yet.
Each label I print will vary slightly in one field (this data is from scales via serial connection). I'd like any advice re neat and foolproof systems for printing this data. The solution is no good if code fails because two word applications are open or anything vague like that. I will print a summary with a total weight from my dataset after printing a batch of labels. It seems neat to save an xml file at this point and fill in a Word.XML template from the saved data. The individual labels have still got me scratching my head and slowly exploring vb.net.
Points: I can do 500 and spread em around if people will be so kind as give some ideas that might save me a bit of time. I don't expect there are right and wrong answers to this, rather there may be insightful assistance If I'm lucky.