By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,472 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,472 IT Pros & Developers. It's quick & easy.

PRINTING textfile + vba

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
Just print the file on paper
Nov 13 '05 #3

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.