Solved

black text appears in the shaded box?

Posted on 2002-04-08
7
315 Views
Last Modified: 2012-06-27
How do you print a shaded rectangle (box) containing black text by using Printer object? I don't want any API! Any ideas?
0
Comment
Question by:computer1000
7 Comments
 

Author Comment

by:computer1000
ID: 6926490
I mean, how do I print the black text in the shaded box on the paper.
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 6926565
You could do something like this:

Printer.DrawWidth = 5
Printer.Line (50, 50)-Step(1440, 1440), , B

Printer.CurrentX = 500
Printer.CurrentY = 500
Printer.FontSize = 20
Printer.FontBold = True
Printer.Print "test"
0
 

Author Comment

by:computer1000
ID: 6926574
Yes I could do something like that above. I use my code below.

'Printer.DrawWidth = 5
'Printer.FillColor = &H808080
'Printer.FillStyle = 0
'Printer.ForeColor = vbBlack
'Printer.FontTransparent = True
'Printer.Print ""
'Printer.Print "Hello this is a test"
'Printer.Line (0, 500)-(1400, 200), &HC0C0C0, B
'Printer.EndDoc

It does not show a shaded box here. What's wrong with my code?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 18

Expert Comment

by:Crash2100
ID: 6926611
What do you mean by it doesn't show a shaded box, it doesn't print anything?  If so, it may be outside your printer's minimum margins.  Try this and see if it works.


Printer.DrawWidth = 5
Printer.FillColor = &H808080
Printer.FillStyle = 0
Printer.ForeColor = vbBlack
Printer.Line (0, 0)-(5000, 5000), &HC0C0C0, B

'Change the current x and y locations to where
'you want to print the text
Printer.CurrentX = 1500
Printer.CurrentY = 2500

Printer.FontBold = True
Printer.Print "Hello this is a test"

Printer.EndDoc
0
 
LVL 5

Accepted Solution

by:
bob_online earned 150 total points
ID: 6927864
I assume that your code is not really all commented out...


swap these two lines and try it...

Printer.Line (0, 500)-(1400, 200), &HC0C0C0, B
Printer.Print "Hello this is a test"

My guess is that the box is covering the text (and no, the text would not show through because the box command is replacing the "pixels" of the text with the lighter color.

I haven't tried this and may be wrong, but I do know that this how the printer object behaves.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7643055
Hi computer1000,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept bob_online's comment(s) as an answer.

computer1000, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7673280
Moving to the PAQ

kb
Experts Exchange Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

929 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

10 Experts available now in Live!

Get 1:1 Help Now