LOGIN
Harsha Alva
92
Community Expert
Mechanical Engineer + Software Developer
 · MangaluruIndia
Share
Report
Get Link
QUESTION
Open

Printing an invoice with VB 6.0

I need to do some maintenance work for my family business’s invoicing software that was built with Visual Basic 6.0 during early 2000 and the database used is Microsoft Access 2003.

An Epson ESC/P2 compliant dot-matrix printer is used for printing the invoices. The invoicing program does not access the printer directly. Instead, it saves an invoice with the necessary ESC/P2 codes to a temporary text file and then executes the DOS command PRN.

I need to add a few tax fields due to the rollout of the Goods and Services Tax in India. As dot matrix printers are difficult to obtain these days, I’m thinking of updating this program with support for laser printers.

How can I print an MS Word template file with the required variables for the invoice directly from the program without having to open MS Word?

Note: The source code, database and invoice text file cannot be made public as it involves personal and confidential data of third parties.

Contributions
Ranjan Dailata

Highlighted the difference between invoicing and printing.

Robert Lancer

Suggested HTML over MS Word

0 like 
Like
Award Contribution
Robert Lancer
53
Community Expert
Chief Technology Officer at Collaborizm
 · New YorkU.S.
Share
Report
Get Link

Can you scrap MS Word and generate a PDF for it to print? Would make it as lot easier because you could generate a PDF using an HTML to PDF converter.

Contribution

Suggested HTML over MS Word

Like
1 like 
Award Contribution
Harsha Alva
92
Community Expert
Mechanical Engineer + Software Developer
 · MangaluruIndia
Share
Report
Get Link

Good idea Robert Lancer
Would just have to fill data into placeholders.

But the printing must be handled by VB.

Like
1 like 
Award Contribution
Robert Lancer
53
Community Expert
Chief Technology Officer at Collaborizm
 · New YorkU.S.
Share
Report
Get Link

Can VB just output the required fields to files and then a node application can watch the file system and render PDFs for the printer?

Like
0 like 
Award Contribution
Ranjan Dailata
73
Community Expert
Application Architect/Lead Developer
 · ChicagoU.S.
Share
Report
Get Link

Printing and Invoicing are two different aspects. Hence, you can literally take out these dependencies. I suggest upgrading the VB 6.0 code to .NET Windows Form App so it’s easy to maintain and extend the codebase. Once you upgrade, printing is an easy process. There’s no reason for the “print” to be specific to dot matrix or laser.

Contribution

Highlighted the difference between invoicing and printing.

Like
1 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link
Write something before you submit it!
Photo updated
Request Sent!
Updated
Copied to Clipboard