Solved

Print the content of a label?

Posted on 2000-04-10
10
158 Views
Last Modified: 2010-05-02
Hello,

I have dumped some text in a label and wish to print it. Is it possible or do i have to use a RTB? if is it could you plz give some code, info on how to do it.

Thanks in advance

Luthar
0
Comment
Question by:luthar
10 Comments
 
LVL 2

Expert Comment

by:Crin
ID: 2702388
Hello luthar,

What do you mean by "print"? And what distinguishes in this case between RTB and Label?

You could access Label.Caption property or RichTextBox.Text or RichTextBox.RTFText properties...

so...

is
Debug.Print Me.Label1.Caption
the answer?

Sincerely yours,

Crin

PS. Sorry, English is not my native language... :(
0
 
LVL 27

Accepted Solution

by:
Ark earned 30 total points
ID: 2702393
Hi
Printer.Print Label1.Caption
Cheers
0
 

Author Comment

by:luthar
ID: 2702397
Sry i should have been more clear in my question.

I wish to send the content of my label to my printer so i get a printed document that has all the characters my label had.


hope it's clearer...
0
 
LVL 2

Expert Comment

by:Crin
ID: 2702435
Yes, Ark is absolete right

Printer.Print Me.Label1.Caption

(Also me :) one thing - I had posted code to print to debug window :))

Sincerely,

Crin
0
 
LVL 6

Expert Comment

by:Marine
ID: 2702437
Private Sub Form_Click()
Printer.Print Label1.Caption
End Sub

Private Sub Form_Load()
Label1.Caption = "VALERA" & Chr(13) & Chr(10) & _
"DAMN"
End Sub
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:luthar
ID: 2702448
Umm i've tried your code and it works...well sort of..

The printing only starts when i quit my program...any idea why?
0
 

Author Comment

by:luthar
ID: 2702450
Nevermind...i forgot to add printer.enddoc :D

thx :)
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2702452
Printer.Enddoc
0
 
LVL 7

Expert Comment

by:kamall
ID: 2702478
Use:
Printer.Print Label1.Caption
Printer.EndDoc

Regards.
0
 

Expert Comment

by:Psy
ID: 2704650
If you want to create a document, something like word makes it is not enough to use a simple label. You have to use the printer object (or  a crystalreport control etc.) to do this. If you just send something to the printer...well it's not enough if you want to make something beautiful. I will help for you with that if you want. If not luthar's and kamall's answer is absolutely correct.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now