Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to send a non-text file to print
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00329489
Message ID:
00329495
Views:
26
>My company currently sends reports to files for archiving purposes, and then prints them at a later time. They send them in ASCII style, so it's really just a text file. I'd like to be able to just send them not in ASCII format, because I want all of the lines, fonts, etc., to be used, but I'm not sure how to send it to print once it has been send to file. I asked a question earlier that sent me in the right direction (I believe), but I can't seem to get it to work.
>
>Here's what I'm doing:
>
>DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
> STRING @SourceFileName, ;
> STRING @DestFileName, ;
> INTEGER bFailIfExists
>
>IF CopyFile('c:\whatever.tmp','LPT1:',0) != 0
> * It worked
>ELSE
> * It didn't
>ENDIF
>
>It never works for me. I've tried changing the port name ("LPT1:") to different ports and printer names, but it always returns a 0 and never prints. Am I doing something wrong. FYI, I'm using VFP5.
>

Are you trying to send the file to a remote printer? If so, try specifying the printer UNC rather than a local port.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform