Re: using print in VBASIC 6

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joe \ (joe_at_bftsi0.UUCP)
Date: 02/22/04


Date: Sun, 22 Feb 2004 14:18:28 -0800


"Verle" <k8vw(dontuse)@tir.com> wrote in message <news:4DFF3367-B82B-4869-8235-CA3411E4D904@microsoft.com>...

> When I try to use print text what prints out an unreadable font showing
> the correct number of characters. I am using an HP DeskJet 672C
> printer which works fine for everything else. Can anyone help me out?

You probably need to set the font. This function might be helpful:

Public Function Font(Optional ByVal Name As String, Optional ByVal Size As Currency = -1@, _
  Optional ByVal Weight As Integer = -1, Optional ByVal Charset As Integer = -1, _
  Optional Bold As Boolean, Optional Italic As Boolean, _
  Optional Strikethrough As Boolean, Optional Underline As Boolean) As StdFont

  Set Font = New StdFont

  If Len(Name) > 0 Then Font.Name = Name
  If Size >= 0 Then Font.Size = Size
  If Weight >= 0 Then Font.Weight = Weight
  If Charset >= 0 Then Font.Charset = Charset
  If Bold Then Font.Bold = Bold
  If Italic Then Font.Italic = Italic
  If Strikethrough Then Font.Strikethrough = Strikethrough
  If Underline Then Font.Underline = Underline

  'With Font
  ' Debug.Print "Font("""; .Name; """;"; .Size; ";"; .Weight; ";"; .Charset;
  ' Debug.Print "; "; .Bold; "; "; .Italic; "; "; .Strikethrough; "; "; .Underline; ")"
  'End With
End Function

You may need to select "OLE Automation" in the References.

Use Font() like this:

Set Printer.Font = Font("Arial", 10)

Printer.Print "This is a test!"
' etc etc etc

--
Joe Foster <mailto:jlfoster%40znet.com>     Got Thetans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!


Relevant Pages

  • Re: Strikethrough Red and Underline Blue Macro
    ... So what colour do you want if both strikethrough & underline. ... Dim cel As Range ... Dim ch As Font ...
    (microsoft.public.excel.programming)
  • Re: "Underline Style" Wont Default
    ... I pressed this OK and the window went away. ... I did what you said about choosing "none" in the font window. ... I don't care if I have any other underline line... ... Since you changed the default paragraph style, ...
    (microsoft.public.mac.office.word)
  • Re: How do I put sub/superscript under a blank?
    ... Be sure to position the text box (Format ... it will move with the underline. ... never was able to get the fraction line at the baseline of the rest of the ... smaller font size) with center-aligned tab stops. ...
    (microsoft.public.word.docmanagement)
  • Re: Font Question
    ... I ended up defining my own font that has strikethrough ... redefined at overline height... ... Fails using DirectX version....apparently, I can get neither ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Mobile2Market help...
    ... Peter, can you provide an example of this that I can look at? ... >> bold, italic, underline. ... >> combobox for the font, and under it, one for font size. ...
    (microsoft.public.dotnet.framework.compactframework)