In vb6 I want to convert a text file(assci file) to the pdf format. I need to manipulate and massage the file in vbscript first. Is ther a pdf converter I can use in vb6?
Do you know of a way to take text from a text file and convert it to a PDF format using VB6. If so, I am very interested. I have the full version of Adobe and someone has written a program that uses the printer object and they are printing the file to a PDF but they would like the promopt not to appear. We really don't want to buy an additional application to do this. Any suggestions?
Private Sub howtoconvertwordtopdf()
'Option Explicit
' Dim myWord As Word.Application
' Dim myDoc As Word.Document
' Dim OriginalPrinter As String
'
' Set myWord = New Word.Application
'
' Set myDoc = myWord.Documents.Open("your_document_name")
' OriginalPrinter = myWord.ActivePrinter
' myWord.ActivePrinter = "PDFWriter"
' myDoc.PrintOut
' myWord.ActivePrinter = OriginalPrinter
' myDoc.Close (False)
' myWord.Quit
' Set myWord = Nothing
End Sub
'Module for creating PDF file automatically from Crystal Report
Private Sub exporttopdf(repname As String)
' Crystal Report Viwer in the form is made visible enabled and required options set
CRVReport.Visible = True
With crxrpt.ExportOptions
.DestinationType = crEDTDiskFile
.FormatType = crEFTPortableDocFormat
.DiskFileName = App.Path & "\" & repname & ""
End With
On Error GoTo ER
crxrpt.Database.Tables(1).SetLogOnInfo "odbcsource", strDBNameOrPath, strUserID, strPassword
crxrpt.Export False
cmdclose.Visible = True
CRVReport.Top = 20
CRVReport.Left = 20
CRVReport.Height = Me.Height - 1000
CRVReport.Width = Me.Width - 200
cmdclose.Top = CRVReport.Top + CRVReport.Height + 100
cmdpdf.Top = CRVReport.Top + CRVReport.Height + 100
Exit Sub
ER:
MsgBox "Database Busy to access , try some other report and come back"
Exit Sub
End Sub
BTW, since this thread has made a reappearance, if you've got Word 2007 (and have got hold of Microsoft's Office 97 SaveAsPDFandXPS addin, which they bizarrely didn't ship on the DVD) it's as simple as:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.