Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2004, 12:47 AM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to print on DMP

hai
i am create a text file using vb-open-print tax(x) commands
and how to print on dot matrix printer ( it may be aliagnment problem)
reg.

 
Old September 30th, 2004, 06:22 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Anantsharma Send a message via Yahoo to Anantsharma
Default

Well if u say alignment, its the duty of code forming the text file. There u have to take care while setting coordinates using TAB().

Create text file is to be saved. Now follow these steps to print with DMP.

1) create a DOS batch file using VB itself in the same fashion u have created text file with.

Bacthc file should contain this line:-

TYPE c:\a.txt>prn ''''I assume that C:\a.txt is to be printed.

please manage the path of text file.
Now save this batch file. For example with the name "DMPout.bat"

2)Now Declare a variable without any datatype in VB (may be inside a button click)

Public Sub PrintData()
   Dim RetVal
   RetVal = Shell ("c:\DMPOut.bat")
   Kill "c:\DMPout.bat"
   unload me
End SUB

This will send the output through the DOS Shell and so its very fast on DMPs. Make sure to make ur DMP as default printer before firing the code. U can use CommonDialog's ShowPrint method to set the printer settings.

B. Anant





Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox problem print preview vs. print jenisageek Access 5 May 2nd, 2008 12:54 PM
print the hidden page without the print dialog box kayzem Classic ASP Basics 0 April 21st, 2005 11:31 PM
Print and print preview file on the website withou appleLover General .NET 0 February 19th, 2005 02:24 AM
vb-printing on DMP kumar Beginning VB 6 1 September 30th, 2004 06:24 AM
how to print text file on DMP kumar Pro VB 6 8 May 11th, 2004 12:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.