Hi,
I want to convert my word file to pdf file in vb6.
source code will be appreciated.
so far, i have tried with below code also.
Private Sub Convert_WordDoc_to_PDF(DocPath As String, sDestsPDFFile As String)
'Dim worddoc As New Word.Application
Dim worddoc As Object
Set worddoc = CreateObject("Word.Application")
Dim x As String
Dim doc As Document
On Error GoTo Errhnd
x = DocPath
Set doc = worddoc.Documents.Open(x) '-----------open the docx
'now docx file is already open . so now it is time to export into PDF Format
doc.ExportAsFixedFormat OutputFileName:= _
x & "/" & sDestsPDFFile, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:=wdExportOptimizeForPrint, Range:= _
wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentContent, _
IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:= _
wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:= _
True, UseISO19005_1:=False
doc.Close
Exit Sub
Errhnd:
MsgBox (err.Description)
Set worddoc = Nothin
End Sub
but gives error at doc.ExportAsFixedFormat line that 'Method or data member not found.'
Thanks