Solved

Print the content of a label?

Posted on 2000-04-10
10
163 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 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 211
Paint/Redraw window while dragging 16 82
RUNRMTCMD from AS/400 12 69
how to Classify of email (pdf attachments) 7 45
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

861 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