Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Anyone know how to copying files direct to printer port?

134 views
Skip to first unread message

Rachel Larkin

unread,
Oct 30, 2000, 4:56:57 PM10/30/00
to
I am trying to put a new front end on a plot file database to replace an Old
Visual Basic program. All I need to do is copy a file from a server drive to
the LPT port however Access 97 will not let me?

If I open a dos prompt from Windows every thing is fine using the command
'Copy C:\autoexec.bat lpt1' however if I try and use FileCopy
"C:\Autoexec.bat","LPT1" from within Access the LPT1 parameter causes an
error.

Also if I try and use the shell command to run a batch file containing the
command 'Copy C:\autoexec.bat lpt1' the lpt1 parameter is not accepted even
though it does work when typed in directly or run from a DOS window.

Any ideas why or how else I can achieve the above via another route? I'm
stumped at the moment.

TIA

Gary.


Michael Blake

unread,
Oct 30, 2000, 5:06:04 PM10/30/00
to
Is the file you are copying always the same file? If it is, why not create
a batch file with the command and then shell the batch file you create?

Michael


"Rachel Larkin" <rachel...@virgin.net> wrote in message
news:E9mL5.30247$h%4.24...@news2-win.server.ntlworld.com...

Jean-Eric Baribeau

unread,
Oct 30, 2000, 6:57:32 PM10/30/00
to
Try
copy C:\autoexec.bat //(computer name)/(printername)

It just work fine for me. I don't remender if it's a slash or a back slash!!

Jean-Eric

"Rachel Larkin" <rachel...@virgin.net> wrote in message
news:E9mL5.30247$h%4.24...@news2-win.server.ntlworld.com...

Lyle Fairfield

unread,
Oct 30, 2000, 7:58:58 PM10/30/00
to
Sub test()
printFile "c:\my documents\interdev\webcalendar\webcalendar_local
\popupcalendar.js", "lpt1"
End Sub

Sub printFile(vStrPath As String, vStrPrinterPort As String)
Dim lngFileNumber As String
Dim strPrintStream As String

strPrintStream = String(FileLen(vStrPath), vbNullChar)

lngFileNumber = FreeFile()
Open vStrPath For Binary As #lngFileNumber
Get #lngFileNumber, , strPrintStream
Close #lngFileNumber

lngFileNumber = FreeFile()
Open vStrPrinterPort For Output As lngFileNumber
Print #lngFileNumber, strPrintStream
Close #lngFileNumber

End Sub

Warning ... this prints the file "AS IS" /// so if any lines are too long they
run off the page ... they are not wrapped.


rachel...@virgin.net (Rachel Larkin) wrote in
<E9mL5.30247$h%4.24...@news2-win.server.ntlworld.com>:

>I am trying to put a new front end on a plot file database to
>replace an Old Visual Basic program. All I need to do is copy
>a file from a server drive to the LPT port however Access 97
>will not let me?

--
Lyle
http://www.cyriv.com/

0 new messages