Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word DOC to PDF?
Message
De
30/01/2010 14:30:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
01446660
Message ID:
01446665
Vues:
72
>Hello, and thanks for your help!
>
>I'd like to get some help about converting Microsoft Word (DOC) files to PDF, I cannot use a printer driver, this must be done within the application. Any help will be GREATLY appreciated.
>
>Thanks!
>
>Juan

Juan,

Do you have word 2007 ? http://msdn.microsoft.com/en-us/library/bb256835.aspx
#define wdExportFormatPDF 17
#define wdExportFormatXPS 18

#define wdExportOptimizeForOnScreen 1
#define wdExportOptimizeForPrint 0

#define wdExportAllDocument 0 &&Exports the entire document.
#define wdExportCurrentPage 2 &&Exports the current page.
#define wdExportFromTo 3 &&Exports the contents of a range using the starting and ending positions.
#define wdExportSelection 1 && Exports the contents of the current selection.

#define wdExportDocumentContent 0 &&Exports the document without markup.
#define wdExportDocumentWithMarkup 7 && Exports the document with markup.



local obj, FileIn, FileOut, ReadOnlyMode
FileIn = 'D:\tmp\aaa.doc'
FileOut = forceext(m.FileIn, 'pdf')

ReadOnlyMode = .t.
obj = createObject('Word.Application')

=obj.Documents.Open(m.FileIn, , m.ReadOnlyMode)

local OpenAfterExport
OpenAfterExport = false

=obj.ActiveDocument.ExportAsFixedFormat( ;
m.FileOut, ;
wdExportFormatPDF, ;
m.OpenAfterExport, ;
wdExportOptimizeForPrint, ;
wdExportAllDocument, ;
, ;
, ;
wdExportDocumentContent, ;
true, ;
true, ;
0, ;
true, ;
true ;
)

=m.obj.Quit()
obj = null
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform