Print method and others 
Author Message
 Print method and others

Can anyone tell me how to replace the MsgBox function with something
more robust?

I'm writing a program in VBScript but it is *NOT* going to run on a
browser or as an ASP.  I'm simply writing a short numerical tool program
that can run on a windows desktop as a .VBS file using Windows Scripting
Host (WSH).  The script will NOT be used as a script on a web page.

Now, the program does a calculation based on some user supplies input.
So far, the only way I can report to the user whats going on is like
this:

Dim i
Private Sub Loop  
  For i = 1 to 10
     MsgBox "Hello World #" & i
  Next
End Sub
Loop

Now, every time the loop completes, it sends out a Message Box
containing "Hello World #1", "Hello World #2",..... "Hello World #10"
HERE MY BIG PIEVE:  Each time you get the MsgBox, the user has to click
"OK" to get the next information about the next iteration of the loop.

Why can I just print to a text box or a picture box or something so I
would get the following all at once:

"Hello World #1"
"Hello World #2"
"Hello World #3"
.
.
.
"Hello World #10"

Public Sub Rant
I remember from the old days of BASIC that you could use the Print
statement to get this kind of result <in the old days when programming
was simple :)> I just wanna print to a stupid text box or something!
This shouldn't be hard, but I'm having a heck of a time figuring out how
to do it.I've used Sam's TY Visual Basick in 24 Hours. MS Step by Step
VB 5.0 and the online tutorials on Visual Basic Script, and I still cant
figure this out!  PLEASE HELP!!!!
End Rant

--

Donald A. Baker
{*filter*}ia Tech
Department of Mechanical Engineering
12-D Randolph Hall
231-9063
http://www.*-*-*.com/ :10021/D/dobaker4/dbresume.html
FEA, solids, 3D, finite element, ALGOR, CADKEY, IDEAS



Wed, 01 Aug 2001 03:00:00 GMT  
 Print method and others
I am not quite sure if this is what you are looking for but if you try using
the loop to minuplate the information
but use the message box outside the loop eg

Dim x As Integer
Dim Myreturned As String
For x = 1 To List1.ListCount
    Myreturned = Myreturned & "Hello World" & x & Chr(13)
Next x
MsgBox Myreturned, vbInformation

   -**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet



Thu, 02 Aug 2001 03:00:00 GMT  
 Print method and others

Quote:

>Can anyone tell me how to replace the MsgBox function with something
>more robust?

>I'm writing a program in VBScript but it is *NOT* going to run on a
>browser or as an ASP.  I'm simply writing a short numerical tool program
>that can run on a windows desktop as a .VBS file using Windows Scripting
>Host (WSH).  The script will NOT be used as a script on a web page.

>Now, the program does a calculation based on some user supplies input.
>So far, the only way I can report to the user whats going on is like
>this:

>Dim i
>Private Sub Loop  
>  For i = 1 to 10
>     MsgBox "Hello World #" & i
>  Next
>End Sub
>Loop

>Now, every time the loop completes, it sends out a Message Box
>containing "Hello World #1", "Hello World #2",..... "Hello World #10"
>HERE MY BIG PIEVE:  Each time you get the MsgBox, the user has to click
>"OK" to get the next information about the next iteration of the loop.

>Why can I just print to a text box or a picture box or something so I
>would get the following all at once:

>"Hello World #1"
>"Hello World #2"
>"Hello World #3"
>.
>.
>.
>"Hello World #10"

>Public Sub Rant
>I remember from the old days of BASIC that you could use the Print
>statement to get this kind of result <in the old days when programming
>was simple :)>

You still can. You just need to tell Visual Basic where to print it:

Dim i As Integer

For i = 1 To 10
  Picture1.Print "Hello World " & i
  'This prints to a picture box.
  'To print to the form use Me.Print.
  'To print to the printer use Printer.Print.
  'To print to the immediate window use Debug.Print (This works only
  'from within the IDE).
Next i

Ole
-
Ole I. Hougaard



Fri, 03 Aug 2001 03:00:00 GMT  
 Print method and others


Quote:
>You still can. You just need to tell Visual Basic where to print it:

>Dim i As Integer

>For i = 1 To 10
>  Picture1.Print "Hello World " & i
>  'This prints to a picture box.
>  'To print to the form use Me.Print.
>  'To print to the printer use Printer.Print.
>  'To print to the immediate window use Debug.Print (This works only
>  'from within the IDE).
>Next i

I forgot: If you print on a form or a picture box, you need to set the
AutoRedraw property to true. Otherwise, you the text will disappear
when the form or picture box redraws.

Ole
-
Ole I. Hougaard



Fri, 03 Aug 2001 03:00:00 GMT  
 Print method and others
DB

You can do what you want to. Either use the Print method on a PictureBox or
add to the end of the Text property of a multi-line TextBox or use the
AddItem method on a ListBox.

Regards
{*filter*}

Quote:

>Can anyone tell me how to replace the MsgBox function with something
>more robust?

>I'm writing a program in VBScript but it is *NOT* going to run on a
>browser or as an ASP.  I'm simply writing a short numerical tool program
>that can run on a windows desktop as a .VBS file using Windows Scripting
>Host (WSH).  The script will NOT be used as a script on a web page.

>Now, the program does a calculation based on some user supplies input.
>So far, the only way I can report to the user whats going on is like
>this:

>Dim i
>Private Sub Loop
>  For i = 1 to 10
>     MsgBox "Hello World #" & i
>  Next
>End Sub
>Loop

>Now, every time the loop completes, it sends out a Message Box
>containing "Hello World #1", "Hello World #2",..... "Hello World #10"
>HERE MY BIG PIEVE:  Each time you get the MsgBox, the user has to click
>"OK" to get the next information about the next iteration of the loop.

>Why can I just print to a text box or a picture box or something so I
>would get the following all at once:

>"Hello World #1"
>"Hello World #2"
>"Hello World #3"
>.
>.
>.
>"Hello World #10"

>Public Sub Rant
>I remember from the old days of BASIC that you could use the Print
>statement to get this kind of result <in the old days when programming
>was simple :)> I just wanna print to a stupid text box or something!
>This shouldn't be hard, but I'm having a heck of a time figuring out how
>to do it.I've used Sam's TY Visual Basick in 24 Hours. MS Step by Step
>VB 5.0 and the online tutorials on Visual Basic Script, and I still cant
>figure this out!  PLEASE HELP!!!!
>End Rant

>--

>Donald A. Baker
>{*filter*}ia Tech
>Department of Mechanical Engineering
>12-D Randolph Hall
>231-9063
> http://www.*-*-*.com/ :10021/D/dobaker4/dbresume.html
>FEA, solids, 3D, finite element, ALGOR, CADKEY, IDEAS



Fri, 03 Aug 2001 03:00:00 GMT  
 Print method and others
Ole

Not strictly true about AutoRedraw. Some people set it to False and only do
their graphics in the Paint event.

Regards
{*filter*}

Quote:



>>You still can. You just need to tell Visual Basic where to print it:

>>Dim i As Integer

>>For i = 1 To 10
>>  Picture1.Print "Hello World " & i
>>  'This prints to a picture box.
>>  'To print to the form use Me.Print.
>>  'To print to the printer use Printer.Print.
>>  'To print to the immediate window use Debug.Print (This works only
>>  'from within the IDE).
>>Next i

>I forgot: If you print on a form or a picture box, you need to set the
>AutoRedraw property to true. Otherwise, you the text will disappear
>when the form or picture box redraws.

>Ole
>-
>Ole I. Hougaard




Sat, 04 Aug 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Print method and others

2. Need to implement PRINT PREVIEW on a Printer.Print Method

3. Print color to printer using Print Method

4. Help: VB4: Print Method: How use true type fonts when printing to Laser Printers

5. Access 2002 report object print method

6. printout method prints contact 3 times

7. Print method only gives B&W?

8. No printer.print method!

9. print method

10. problems finding methods,properties to print a RTB with headers selected from an access db

11. No printer.print method

12. Print methods

 

 
Powered by phpBB® Forum Software