I need to print text on paper label (e.g. Avery Labels). Where can I found an OCX or coding???
Printable View
I need to print text on paper label (e.g. Avery Labels). Where can I found an OCX or coding???
What do you mean???
(I'm imetating HeSaidJoe!)
What I mean is you know in Micro$oft word, you can print label and set the dimension stuff. But, How can I do that on VB5?
I do not have the answer. I'm just putting a post in this thread to recieve a notice when someone does have the answer.
I'm currently doing the same thing you want, but I use word for it. It would be a lot better if Word would be replaced with code that does the same. Then more people are able to use my program to print labels.
i have created just such a program
using the Printer Object and a lot
of math to figure out the spacing
and dimensions of the inside of
the label to print on.
you need to use
currentx and currenty...
Larryn,
Might it be possible for you to give me a small example of this code. I have never worked with the Printer Object in VB. I want to learn.
Might be possible to send it to [email protected] You have my everlasting gratitude.
I'm a beginner!!! I did a think but, it cannot do the label dimension. Please, help!
---------------------------
I did a similar thing recently - printed out labels. I used the VideoSoft VSPrinter OCX, which is a very nice little printing control (much much easier to work with than the printer object), and wrote a small label designer that let you drag and drop the labels etc.
It's not a difficult job.
Basically you need to define a series of RECT type that specify the positioning of a given bit of text for a SINGLE label, all wit hco-ordinates that are based on the top left of the labal. Then work out how many labels you have per page, and loop thoug all the labels and offset the colection of RECTs you created earlier, print text at that current X and Current Y, and voila! - Label printing.
But it does take a bit of work, particulalrly the label defintion section.
I know this post won't be much help, but it can be done with some effort.
- gaffa
Where can I get that OCX? Is it free???
Larryn had a good suggestion in which you would use CurrentX and CurrentY.
Code:Printer.ScaleMode = vbInches
'Set a 1"x 1" margin
Printer.CurrentX = 1
Printer.CurrentY = 1
Printer.Print Text1.Text
Printer.EndDoc
It not just as straight forward as using currentX and CurentY. You need to get nice and comfortable with TextWidth, TextHeight, and a few others, so that you can handle text wrapping correctly (or not at all depending how you want your labels to print).
The videosoft OCX is not free. In fact its reasonably expensive - about $300US I think, but still an excellent control, particularly if you want print preview and all that stuff. If your programming byyourslef, the its probably not worth it. I got it cos I do a fair bit of reporting and printing as paert of my job
- gaffa