TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: Al Jones alfredmjones{at}sh
date: 2005-02-14 22:45:00
subject: Re: Simple Printing from VB 6

On Mon, 14 Feb 2005 11:10:34 GMT, Don D{at}home.moc wrote:

> On Mon, 14 Feb 2005 10:21:51 GMT, al jones 
> wrote:
>
>>On Sun, 13 Feb 2005 23:58:48 -0500, Hal Rosser wrote:
>>
>>> "al jones"  wrote in message
>>> news:qgcrk0f6joct.175kmj9zzfzv6.dlg{at}40tude.net...
>>>> Does anyone have - or can you point me to - something that
puts all the
>>>> basic elements of printing to the printer together in one place.  (A
>>>> working simple sample would be great!)
>>>>
>>>> I though I had it together from the docs and a few web
samples, but I
>>>> obviously either have them mis-arranged or missing.  I'm
not trying to do
>>>> anything fancy, just some straight printing but I'm
missing something.
>>>
>>> Look at the properties and methods of the printer object in msdn
>>> printer.fontname = "arial"
>>> printer.fontbold =  true
>>> printer.currentx = 125
>>> printer.currenty = 300
>>> printer.print "Hello World"
>>> printer.currentx = 100
>>> printer.print "Bye World"
>>
>>Hal, what you just gave me is what I'm seeing - I spent all day yesterday
>>taking the pieces and putting them together - but never got anything to
>>print so I'm obviously missing something fairly basic.
>>
>>Leaving the print queue for my default printer (Brother MFC on USB)
>>displayed, nothing I've managed to try ever puts anything in the print
>>queue - nothing ever prints - that's why I asked for
"something that puts
>>all the basic elements of printing to the printer together in one
place".
>>If you have one, a pointer to a very simple example would be more than
>>sufficient - I'm not dumb, just dense somethimes.
>
> And don't forget to final step -> printer.EndDoc
>
>
> Have a good day...
>
> Don

This is utter frustration speaking here so don't flame too badly.  I was
asked to convert a very old GWBasic program to something that will
understand windows.  I've managed to get the thing to print to a file in
VB6 / vb.NET and VB 2005.  The problem I encountered in VB.NET is that
there's no reasonable way to intersperse calculations with printed output.


The linguistics exist in VB6 to do what I want - I can find them in
reference books and pieces of code all over the place...  but obviously I
don't see / understand what I'm looking at because, AISI, I can't get
anything to hit the printer.

Are there system includes / import - I don't see any but that would be a
major oversight on my part if it's that basic.  In GWBASIC once could
open("lpt1:" for output as 4) : print #5,"text"  or,
alternatively lprint
"text".

Taken, literally from the July 2000 MSDN:
Printer.Print "This is page 1."
Printer.NewPage
Printer.Print "This is page 2."
Printer.EndDoc
One presumes that if I put this in a function command1_onclick, and click
on the button ... then I should see two pieces of paper with one line of
text on each.  However, I get nada ...

Again, from the same MSDN
Private Sub Command1_Click()
Dim x As Printer
   For Each x In Printers
      Debug.Print x.DeviceName
   Next
End Sub

Given a form with one button - if I click on it I should see all the
various 'printers' (pdf output, printer, fax, etc) that are configured as
printers on my system... again, however, I get nada ...

I'm sorry, I've been looking and all I can find are what, to me, look like
bits and pieces with the 'main ingredient' missing and I have no idea what
that ingredient is.

If you've had the patience to make it though this far in my frustrated
diatribe, could you please offer a working solution - if the problem
resides in my system, not what I'm doing then I'd at least like  to be able
to confirm that - all I know right now is that the printers work from
everything I've tried (word, acrobat, FTW, etc) but not when I try to
access them programatically ... to me it seems as if the problem lies there
but I don't know 'cause I have nothing (I think) that 'should print as it
stands' to verify where the problem is.  fini...  //al


--- UseNet To RIME Gateway {at} 2/14/05 10:10:43 PM ---
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270 5030/786
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.