如何在VB 6.0中将word文档转换为PDF [英] How to convert word document to PDF in VB 6.0
本文介绍了如何在VB 6.0中将word文档转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个代码在VB 6.0中转换PDF格式的Word文档但是当我尝试转换它时会出现错误无效的程序调用
我有什么试过:
I have a code to convert word document in PDF in VB 6.0 But when i try to convert it gives error invalid procedure call
What I have tried:
Dim objDoc As Object
Dim rngRange As Object
Dim WordApp As Object
Set objDoc = CreateObject("Word.Document")
Set WordApp = CreateObject("Word.Application")
With WordApp
Set objDoc = .Documents.Open(g_strPath & "\Documents\Report.doc")
objDoc.activate
WordApp.ActiveDocument.ExportAsFixedFormat OutputFileName:= _
App.Path & "\Documents\Report.pdf", 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
objDoc.PrintOut FileName = "C:\MyReport.pdf"
Set objDoc = Nothing
Set rngRange = Nothing
.visible = True
end with
推荐答案
你必须安装microsoft office add on出口,请参见示例2:
visual-basic-6 - 在vb6.0中将Word文件转换为Pdf文件[求助] | DaniWeb [ ^ ]
You have to install the microsoft office add on for export, see example 2 here:
visual-basic-6 - convert Word file to Pdf file in vb6.0 [SOLVED] | DaniWeb[^]
这篇关于如何在VB 6.0中将word文档转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文