Solved

Print the content of a label?

Posted on 2000-04-10
10
161 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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
 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

823 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