Esportare un word in pdf da Lotus Notes, utilizzando Word 2007

Word 2007 ha la possibilita, previa installazione di un plugin, di esportare il documento in formato pdf. Ho usato questa funzione per esportare in pdf un documento word aperto da uno script notes.

L’apertura del file è sempre la stessa:

Set wordAppObject = CreateObject("Word.Application")
Set wordDocObject = wordAppObject.Documents.Open("c:\prova.doc")

Se si prova a registrare una macro in word, esportando in pdf si ottiene la seguante istruzione:

wordDocObject.ExportAsFixedFormat OutputFileName:= filepdf,
                                  ExportFormat:=wdExportFormatPDF,
                                  OpenAfterExport:=False, 
                                  OptimizeFor:=wdExportOptimizeForOnScreen, 
                                  Range:=wdExportAllDocument,
                                  From:=1, To:=1,
                                  Item:=wdExportDocumentContent,
                                  IncludeDocProps:=True,
                                  KeepIRM:=True,
                                  CreateBookmarks:=wdExportCreateNoBookmarks,
                                  DocStructureTags:=True,
                                  BitmapMissingFonts:=True,
                                  UseISO19005_1:=False

La documentazione della funzione ExportAsFixedFormat si trova qua:

http://msdn.microsoft.com/en-us/library/bb256835.aspx

dove vengono descritti tutti i parametri. Questa istruzione, trasformata in una istruzioni lotus script diventa:

Call wordDocObject.ExportAsFixedFormat(filepdf,
                                            17,
                                         False,
                                             0,
                                             0,
                                             1,
                                             1,
                                             0,
                                          True,
                                          True,
                                              0,
                                           True,
                                           True,
                                           False  )

Dove ho sostituito alle costanti di word i valori presi dalle tabelle qui sotto:

WdExportFormat

wdExportOptimizeForOnScreen

wdExportAllDocument

a href=”http://www.nicolacolonna.it/wp-content/uploads/2008/10/pdf3.gif”>

WdExportItem

WdExportCreateBookmarks

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>