Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

copy File

Posted on 2001-07-23
4
Medium Priority
?
419 Views
Last Modified: 2008-02-01
How Do I Copy A Txt File To LPT1 Port (Visual Basic 6)?
I Know That With The Ms-Dos It Goes Like This :

Copy MyFile.txt LPT1:



0
Comment
Question by:ruby_yeheskel
4 Comments
 
LVL 6

Expert Comment

by:JonFish85
ID: 6308953
try:

Shell "Copy MyFile.txt LPT1"

hope this helps!
0
 
LVL 20

Accepted Solution

by:
hes earned 200 total points
ID: 6308955
Open MyFile For Input As #1
    Open "LPT1" For Output As #2

    TempString = Input(LOF(#1), #1)

    Print #2, TempString;

    Close #1
    Close #2
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6308995
or  you could

open "myfile.txt" for input as#1

while not eof(1)
input #1,string
printer.print string
wend

printer.enddoc
close#1
end sub


hope that helps
this will use your current print driver installed.

cheers
Andy


0
 

Author Comment

by:ruby_yeheskel
ID: 6309039
Thanks hes,

You Answer Was Quick And Helpful !

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question