Can you give a snippet for RTF file to PDF Conversion. ?

Kamlesh
Code: Select all
'This sample converts all RTF files in the Temp folder to one pdf file called 'BatchConvert.pdf
'All RTF files are appended to one PDF. If you remove the Concatenate 'option each RTF file will be converted to a separate pdf
pdf.FileNameOptions = NoPrompt + UseFileName + Concatenate
pdf.DefaultFileName = "c:\Temp\BatchConvert.pdf"
pdf.BatchConvert("c:\Temp\*.rtf")
Code: Select all
'Printing an rtf file while opening it using Word.
'Declarations
'Create a new hidden instance of Word
Set wordapp = New Word.Application
'Create an instance of a Word document
Set worddoc = Word.Documents
' Attach to the existing PDF Printer (Initialize the printer)
pdf.DriverInit (PrinterName)
' Set the PDF Printer as Default
pdf.SetDefaultPrinter
pdf.DefaultFileName = "C:\Temp\Test.pdf"
' Set File options.
pdf.FileNameOptionsEx = NoPrompt + UseFileName
' Open the rtf document
Set worddoc = Documents.Open("C:\Temp\Test.rtf", , , , , , , , , , , True)
' Print the rtf document
worddoc.PrintOut ActivePrinter = PrinterName
worddoc.Close
pdf.FileNameOptions = 0