You would think that the following code would change the current fontof the default printer, but it doesn’t under VB4:
Printer.FontName = "Arial"Printer.FontSize = 11Printer.Print "This is a test."
An undocumented feature of VB4’s Printer object requires that each newpage be initialized before the font can be changed. This code works asexpected:
' Start new pagePrinter.Print' Set margins as desiredPrinter.ScaleMode = vbTwipsPrinter.CurrentY = 720' Now you can set the fontPrinter.FontName = "Arial"Printer.FontSize = 11Printer.Print "This is a test."Printer.EndDoc
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























