Solved

Print the content of a label?

Posted on 2000-04-10
10
166 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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