

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
2 messages in org.openoffice.fr.progscinder une variable doc en pdf| From | Sent On | Attachments |
|---|---|---|
| Gaap | Jul 16, 2007 6:20 am | |
| Laurent Godard | Jul 16, 2007 7:07 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | scinder une variable doc en pdf | Actions... |
|---|---|---|
| From: | Gaap (spo...@fram.fr) | |
| Date: | Jul 16, 2007 6:20:19 am | |
| List: | org.openoffice.fr.prog | |
Bonjour,
je suis nouveau ( la bonne excuse ;) ) et j'ai un soucis sur une variable, j'avais besoin de transformer du doc en pdf et j'ai donc exploiter la macro de BatchConv1.7.sxw qui est formidable d'ailleurs.
Mon soucis est que le fichier d'origine s'appelle toto.doc et lors de sa transformation on garde son petit nom d'origine en toto.doc.PDF, et je n'arrive pas a supprimer .doc de la variable filename.
Quelqu'un aurait il la solution ? j'avoue être un peu perdu dans le monde de OOo et de ses macros.
Merci par avance
voici une copie du code utilisé :
'******************************************************************************** 'Copyright (C) 2006-2007 Laurent Godard 'Laur...@openoffice.org
'This library is free software; you can redistribute it and/or 'modify it under the terms of the GNU Lesser General Public 'License as published by the Free Software Foundation; either 'version 2.1 of the License, or (at your option) any later version.
'This library is distributed in the hope that it will be useful, 'but WITHOUT ANY WARRANTY; without even the implied warranty of 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 'Lesser General Public License for more details. 'http://www.opensource.org/licenses/lgpl-license.php
'You should have received a copy of the GNU Lesser General Public 'License along with this library; if not, write to the Free Software 'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA '******************************************************************************
sub Export2PDF(filename as string)
if not fileExists(filename) then exit sub endif
dim argsLoad(0 ) as new com.sun.star.beans.PropertyValue argsLoad(0).Name = "Hidden" argsLoad(0).Value = True url = convertToURL(filename) theDoc = StarDesktop.loadComponentFromURL(url,"_blank",0,argsLoad())
filtername = ""
if theDoc.supportsService("com.sun.star.text.TextDocument") then
filtername = "writer_pdf_Export"
endif
if theDoc.supportsService("com.sun.star.sheet.SpreadsheetDocument") then
filtername = "calc_pdf_Export"
endif
if theDoc.supportsService("com.sun.star.presentation.PresentationDocument")
then
filtername = "impress_pdf_Export"
endif
if filtername <> "" then
dim argsSave(0) as new com.sun.star.beans.PropertyValue
argsSave(0).Name = "FilterName" argsSave(0).Value = filtername urlDestination = convertToURL(filename & ".pdf") theDoc.storeToURL(urlDestination,argsSave())
theDoc.close(True)
endif
end sub







