Printing .html to doc/rtf

For a copy of the sample project please
click here
to download and install the product evaluation.
Introduction
Our Amyuni Document Converter Suite product is a virtual printer driver that will converter output sent to it from a printing application into PDF, XPS, RTF, HTML, XLS, TIFF, JPEG/BMP formats.
The developer has full control over the printing process and printer configuration.
Detail
The code snippet below prints an HTML file into RTF/DOC
Private Sub Command1_Click()
Dim status As OLECMDF
Dim rstate As Variant
With PDF
.FileNameOptionsEx = NOPROMPT + USEFILENAME + RTFExport
.CaptureEvents True
'/////////////////////////////////////////////////////////////
'RTF Format Integer Option for formatting the RTF output
'0 – Advanced RTF
'1 – Full RTF
'2 – Formatted Text
'3 – Non-formatted Text Only
'Example: PDF.PrinterParamInt("RTF Format") = 3
'////////////////////////////////////////////////////////////
'Use Tabs Integer Option to replace tabs by spaces
'0 – Do not replace
'1 – Replace
'Example: PDF.PrinterParamInt("Use Tabs") = 0
.PrinterParamInt("Use Tabs") = 0
.PrinterParamInt("RTF Format") = 0
'set output PDF directory name
.DefaultDirectory = App.Path
'set output PDF file name
'This will produce an RTF and PDF
.DefaultFileName = App.Path & "\samplePDF.pdf"
'Not needed
Set myDoc = WebBrowser1.Document
'Sets PDF printer as default printer
.SetDefaultPrinter
.EnablePrinter strLicenceTo, strActivationCode
On Error Resume Next
'get status of current page if needed
status = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
'check for error
If Err.Number = 0 Then
'There was no error.
If status And OLECMDF_ENABLED Then
' The operation is available. Print.
WebBrowser1.ExecWB OLECMDID_PRINT, _
OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
Else
' The operation is not available.
MsgBox ("not ready")
End If
End If
End With
End Sub
Visit
Amyuni Technologies Inc
for more information and more samples.