Output to default printer...

Status
Not open for further replies.

countyarchitect

Beta member
Messages
2
Greetings:

I have the following snip that "dumps" the result to the Immediate Window.

Dump:
For j = 0 To iTotalCount - 1
Debug.Print strAllCategories(j), iDurationPerCategory(j)
Next

I'd like to get the results sent to the default printer, but don't know how. Help would be very much appreciated.
 
dump it to a file and use .print?

Using system default printer to print a file out : Desktop « JDK 6 « Java

Code:
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;

public class Test {
  public static void main(String[] a) {
    try {
      Desktop desktop = null;
      if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
      }

       desktop.print(new File("c:\\a.txt"));
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }

  }
}
 
Status
Not open for further replies.
Back
Top Bottom