473,388 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

PRINTING textfile + vba

I've created a textfile (log) with errors in vba and know i want to
print it but i don't know how! Does anywhone have experience with
this?
Nov 13 '05 #1
5 2459
Not sure on what you are trying to accomplish. Are you trying to create a
pollished report of just spit out your text file?

Scott

"@ndy" <an*******@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
I've created a textfile (log) with errors in vba and know i want to
print it but i don't know how! Does anywhone have experience with
this?

Nov 13 '05 #2
Just print the file on paper
Nov 13 '05 #3
Try "copy textfile.txt prn" in a shell command. Haven't done this in a while
and don't want to test this right now.

Scott

"@ndy" <an*******@hotmail.com> wrote in message
news:6c**************************@posting.google.c om...
I've created a textfile (log) with errors in vba and know i want to
print it but i don't know how! Does anywhone have experience with
this?

Nov 13 '05 #4
Scott Simonson wrote:
Try "copy textfile.txt prn" in a shell command. Haven't done this in a while
and don't want to test this right now.


I was going to suggest something similar but using VBA to open LPT1, but
then remembered we aren't in DOS anymore and printers do come in network
and USB flavours :-)

--
This sig left intentionally blank
Nov 13 '05 #5
In message <41**********************@news.zen.co.uk>, Trevor Best
<no****@besty.org.uk> writes
Scott Simonson wrote:
Try "copy textfile.txt prn" in a shell command. Haven't done this in
a while and don't want to test this right now.


I was going to suggest something similar but using VBA to open LPT1,
but then remembered we aren't in DOS anymore and printers do come in
network and USB flavours :-)


If your system has a copy of Wordpad on it you can issue a shell command
like

"c:\program files\windows nt\accessories\wordpad.exe" /p stuff.txt

This will print the file stuff.txt to the default printer. You can do
the same with Word (or many other Windows programs.) If you use Word you
can use a command line switch to execute a macro. The macro could format
the text, apply a page header etc.

Alternatively you could use docomd.transfertxt to import the text file
to an access table and then run a fancy report against the data.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Hans A | last post by:
I have a textfile "textfile.txt" containing a list of words. There is one word on each line. I want to pick two random lines from this textfile, and I have tried to do something like: //Loading...
1
by: Aditya | last post by:
Hi, I am working on a Web based Intranet application and one of the requirements of the project is to print to a dot matrix printer. The users access the application through a web browser (IE)...
2
by: Marc Champagne | last post by:
Hi folks, I wish to print on pre-printed continuous forms on a dot matrix printer. My initial intent was to access to printer directly (in raw mode, somehow) in order to send whatever is...
1
by: @ndy | last post by:
I've create a logfile (.txt) know i won't to print it automatic. How can i print a textfile with VBA?
1
by: reidarT | last post by:
There is an example on PrintDocument.PrintMethod that I want to use when printing text from a streamreader textfile. I can't find out how to call the code from a printbutton. The code starts with...
2
by: Teemu | last post by:
I have an application created with VB6 and now I'm converting it to VB 2005. Conversion is not so simple because printing is so much different. In my app I have Timer-component, which is creates...
1
by: kachokaratz | last post by:
well i have a problem in my project..since the contents of my textfile is too long, i was wondering how to output the textfile in such a way that you can divide the contents to be able to output...
14
by: blumen | last post by:
Hi all, I'm a newbie in VB.Net Programming.. Hope that some of you can help me to solve this.. I'm working out to read,parse and save textfile into SQL Server. The textfile contains thousands...
1
by: asedt | last post by:
With my Excel macro and two text files I want to create a new textfile containing the first textfile then text from the sheet and then the second textfile. My problem is that i don't know how to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.