|
-
March 22nd, 2001, 01:25 PM
#1
Writing and Printing from a File
I would like to generate a HTML file based on data I retrieve from the database. I want to be able to write the file, save the file, and print the file automatically with no user intervention. Can anyone give me a clue as to how to write the HTML file and then automatically print it?
Many thanks for any suggestions!
Greg
-
March 22nd, 2001, 02:10 PM
#2
Re: Writing and Printing from a File
Open "c:\temp\temp.html" For Output As #1 'to write to
Print #1, YourString
Close #1
'to print
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Dim lngResult As Long
lngResult = ShellExecute(Me.hwnd,"Print",strFile,0&,0&,vbMinimized)
where strFile is the full path to your file
Iouri Boutchkine
[email protected]
-
March 22nd, 2001, 03:24 PM
#3
Re: Writing and Printing from a File
Ok, thats fine but it brings up the printer box and requires the user to select a printer and to click the OK button. I need a way to print the file without the user to click OK.
Thanks,
Greg
-
March 22nd, 2001, 03:54 PM
#4
Re: Writing and Printing from a File
Open "c:\temp\temp.html" For Input As #1 'to read from
Do While Not EOF(1)
Line Input #1, sLine
Printer.Print sLine
Loop
Close #1
Iouri Boutchkine
[email protected]
-
March 22nd, 2001, 05:09 PM
#5
Re: Writing and Printing from a File
Won't this print the actual HTML text and not the processed HTML??
-
July 30th, 2001, 12:17 AM
#6
Re: Writing and Printing from a File
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|