Hi!
can any one help me by providing the method when i open any text file and convert into pdf format. I searched on the net and i got some code but i am not understanding this code and it also produce error on the highlited line. for converting the file can i have to do the refrence to adobe liberary please tell me
Dim wrd As New Word.Applicatio n
Dim doc As Word.Document
wrd.Visible = False
wrd.ScreenUpdat ing = False
wrd.ActivePrint er = "Acrobat Distiller"
'Open the document
Set doc = wrd.Documents.O pen("d:\abc\tes t.doc")
'Print it to a PostScript file using Distiller
doc.PrintOut False, False, , "d:\abc\test.ps ", , , , , , , True
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
'Now call distiller to convert the postscript file to PDF
Dim acr As New ACRODISTXLib.Pd fDistiller//user defined type not defined
acr.bShowWindow = False
acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", True
'acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", 1
Set acr = Nothing
'Delete the old PS file
Kill "d:\abc\test.ps "
'Done
Exit Sub
PDF_error:
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
Set acr = Nothing
can any one help me by providing the method when i open any text file and convert into pdf format. I searched on the net and i got some code but i am not understanding this code and it also produce error on the highlited line. for converting the file can i have to do the refrence to adobe liberary please tell me
Dim wrd As New Word.Applicatio n
Dim doc As Word.Document
wrd.Visible = False
wrd.ScreenUpdat ing = False
wrd.ActivePrint er = "Acrobat Distiller"
'Open the document
Set doc = wrd.Documents.O pen("d:\abc\tes t.doc")
'Print it to a PostScript file using Distiller
doc.PrintOut False, False, , "d:\abc\test.ps ", , , , , , , True
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
'Now call distiller to convert the postscript file to PDF
Dim acr As New ACRODISTXLib.Pd fDistiller//user defined type not defined
acr.bShowWindow = False
acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", True
'acr.FileToPDF "d:\abc\test.ps ", "d:\abc\test.pd f", 1
Set acr = Nothing
'Delete the old PS file
Kill "d:\abc\test.ps "
'Done
Exit Sub
PDF_error:
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
Set acr = Nothing
Comment