Fonttransparent not working when printing

mickmunns
mickmunns used Ask the Experts™
on
Printer object appears to ignore .fonttransparent, and still prints white blocking around the text. I have read a routine on this site provided by Paul Hews in year 2000 using:

Public Const TRANSPARENT& = 1
Public Declare Function SetBkMode& Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long)

lngRet = SetBkMode(Printer.hdc, TRANSPARENT)

...where do I place the lngRet statement in my code, and how do I declare lngRet? Or is there another answer to this problem? Many thanks for help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Project manager
Commented:
Bug, admitted by microsoft

http://support.microsoft.com/default.aspx?scid=KB;en-us;q145726

(for more info see above site)
Workaround:

Private Sub Form_Click()

      Printer.Line (0,0)-(10000, 2000), &HC0C0C0, BF
      Printer.CurrentX = 0
      Printer.CurrentY = 0
      Printer.FontTransparent = True
      Printer.Print "Printer.FontTransparent = " & Printer.FontTransparent
      Printer.FontTransparent = False
      Printer.Print "Printer.FontTransparent = " & Printer.FontTransparent
      Printer.EndDoc

   End Sub

Author

Commented:
Many thanks Dhaest - the routine linked through to solves the problem, though why MS don't bother to get it right in the first place...., thanks for your time and effort.

Author

Commented:
Already posted my thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial