Fonttransparent not working when printing

mickmunns used Ask the Experts™
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.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Project manager
Bug, admitted by microsoft;en-us;q145726

(for more info see above site)

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

   End Sub


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.


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