|
-
Aug 28th, 2000, 09:46 AM
#1
Thread Starter
Lively Member
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.
-
Aug 28th, 2000, 09:49 AM
#2
Try this.
Code:
Printer.Print Label1.Caption
Printer.EndDoc
-
Aug 28th, 2000, 09:56 AM
#3
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.
-
Aug 28th, 2000, 09:58 AM
#4
Thread Starter
Lively Member
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".
-
Aug 28th, 2000, 10:00 AM
#5
Thread Starter
Lively Member
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.
-
Aug 28th, 2000, 12:51 PM
#6
Addicted Member
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
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Aug 28th, 2000, 12:53 PM
#7
Addicted Member
I forgot...
When you end printing, you must write
because if you don't nothing will come out from printer.
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Aug 28th, 2000, 01:23 PM
#8
Thread Starter
Lively Member
Zvonko,
Thanks for your reply. I'll try it and see what happens.
-
Aug 28th, 2000, 01:28 PM
#9
Thread Starter
Lively Member
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?
-
Aug 28th, 2000, 04:06 PM
#10
Addicted Member
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...
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
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
|