-
Hi all,
I was wondering if anyone had a program to print labels.
i would be printing the labels on an old dot matrix printer,
on Avery Style labels. Or if someone could point me in the
right direction as to how and where I would get started. Any
code would be very helpful.
-
Try this.
Code:
Printer.Print Label1.Caption
Printer.EndDoc
-
I don't think he wanted to print out the caption of a VB Label control but to print on labels (Avery Style labels).
Why don't you try to automate Word to do this for you.
-
Megatron,
Tahnks for your reply. I also would like to know how I
set the spacing for the labels. Like I said before i will
be printing on "Avery Style" labels. I am printing addresses
and I need to know how to set up the spacing for each label.
The labels are something like 3" by 1".
-
I need to set this up so that users can use it. Something simple, so Word is not an option. Thanks for the suggestion
though.
-
Try with Printer object:
Code:
Dim DifferenceBetweenLabels 'space between labels
Dim LabelHeight 'height of label
Printer.FontName="Tahoma"
Printer.FontSize=11
Printer.ScaleMode=vbCentimeters
Printer.CurrentX=1.5
Printer.n
For i=0 To NoOfLabels-1
Printer.CurrentY=i*(DifferenceBetweenLabels+LabelHeight) + 2
Printer.Print "";
Printer.Print "Name"; 'semicolon tells VB to go to new line
Printer.CurrentY=i*(DifferenceBetweenLabels+LabelHeight) + 2.5
Printer.Print "Address";
Printer.CurrentY=i*(DifferenceBetweenLabels+LabelHeight) + 3
Printer.Print "City";
Printer.CurrentY=i*(DifferenceBetweenLabels+LabelHeight) + 3.5
Printer.Print "State";
Next
This example will print one column of labels on paper.
Hope I helped
-
I forgot...
When you end printing, you must write
because if you don't nothing will come out from printer.
-
Zvonko,
Thanks for your reply. I'll try it and see what happens.
-
Zvonko,
Hey can you tell me what this code does (Printer.n)?
I'm getting an error and that'swhere it tells me the error is. Was that just a typeo or something?
-
Damn!
Printer.n is just TYPO.
I tried to write something else, but I didn't and I forgot to delete it. Just ignore that line.
Sorry again...