Hi Nils,

Nils Andresen wrote (07-02-11 08:34)
I am trying to export documents to pdf. I have a macro which worked
most of the time using OOo, but it does not work in LO.
I use this code..
--- cut ---
   cDestFile = Left(cSourceFile, Len(cSourceFile) - 4) + "pdf"
   cDestURL = ConvertToUrl( cDestFile )
   Dim oExportOptions(4) as New com.sun.star.beans.PropertyValue
   oExportOptions(0).name = "FilterName"
   oExportOptions(0).value = "writer_pdf_Export"
   oExportOptions(1).name = "Author"
   oExportOptions(1).value = "..."
   oExportOptions(2).name = "Comment"
   oExportOptions(2).value = "..."
   oExportOptions(3).name = "DocumentTitle"
   oExportOptions(3).value = "..."
   oExportOptions(4).Name = "Overwrite"
   oExportOptions(4).Value = True
   oDoc.storeToURL( cDestURL, oExportOptions )
--- cut ---

Any error you get?

However, in my experiance this only worked in OOo when the
"SaveFileAs" dialog showed pdf as a format to "save as".

As far as I remember, it has never been there..

When OOo did not had this option, the macro would not work either.
None of my LO installations have this SaveAs format and the macro
fails in all of my LO installations.
I know there was another way to export to pdf (using "export" instead
of "save as") - but I can't find it anymore...

Yes, File> Export as PDF is the thing.

Do you have a special goal to do it with a macro?

Best regards,
Cor

--
 - giving openoffice.org its foundation :: The Document Foundation -


--
Unsubscribe instructions: E-mail to [email protected]
List archive: http://listarchives.libreoffice.org/www/users/
*** All posts to this list are publicly archived for eternity ***

Reply via email to