473,413 Members | 1,718 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,413 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 2461
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.