Solved

Print the content of a label?

Posted on 2000-04-10
10
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 28

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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 125
VB6 - Convert HH:MM into Decimal 8 75
Collapse and expand table in Word 2010 2 153
can this macro be converted to sub procedure 4 33
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 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