|
-
Nov 9th, 2000, 07:31 AM
#1
Thread Starter
Hyperactive Member
I need to print text on paper label (e.g. Avery Labels). Where can I found an OCX or coding???
-
Nov 9th, 2000, 10:05 AM
#2
Hyperactive Member
<?>
What do you mean???
(I'm imetating HeSaidJoe!)
-
Nov 9th, 2000, 10:11 AM
#3
Thread Starter
Hyperactive Member
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?
-
Nov 9th, 2000, 10:25 AM
#4
Addicted Member
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.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
-
Nov 9th, 2000, 01:16 PM
#5
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...
-
Nov 10th, 2000, 03:22 AM
#6
Addicted Member
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.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
-
Nov 10th, 2000, 08:07 PM
#7
Thread Starter
Hyperactive Member
I'm a beginner!!! I did a think but, it cannot do the label dimension. Please, help!
---------------------------
-
Nov 11th, 2000, 01:12 AM
#8
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
-
Nov 11th, 2000, 01:06 PM
#9
Thread Starter
Hyperactive Member
Where can I get that OCX? Is it free???
-
Nov 11th, 2000, 01:36 PM
#10
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
-
Nov 11th, 2000, 09:42 PM
#11
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|