3 messages in org.openoffice.fr.progRe: [prog] Dialogue enregistrer sous
FromSent OnAttachments
SEGUIN FrançoisMay 20, 2007 11:11 pm 
Francois GattoMay 21, 2007 3:44 am 
SEGUIN FrançoisMay 21, 2007 12:12 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Dialogue enregistrer sousActions...
From:Francois Gatto (oo@volcar.org)
Date:May 21, 2007 3:44:24 am
List:org.openoffice.fr.prog

Bonjour,

SEGUIN François a écrit :

Bonjour,

J'ai créée un boite de dialogue "enregistrer sous" avec un objet "FilePicker"
'jutilise la variable "FILESAVE_AUTOEXTENSION" pour afficher la boite avec une
case à cocher "Extension automatique de nom de fichier". Lors de l'affichage de
la boite la case à cocher apparait non cocher, et j'aimerai qu'elle apparaisse
cocher par défaut. Quelqu'un a t'il une solution.

Ce serait quand même sympa de poster parfois un extrait de code ;)

Quant à ton problème, je pense que quelque chose comme ceci devrait y répondre :

sub SaveWithAutoExtension() dim oDoc, oFilePicker dim sDir as string

'http://api.openoffice.org/docs/common/ref/com/sun/star/ui/dialogs/TemplateDescription.html dim sFPservice

oDoc = ThisComponent sFPservice = Array( com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_AUTOEXTENSION ) oFilePicker = CreateUnoService( "com.sun.star.ui.dialogs.FilePicker" )

'Configuration du FilePicker with oFilePicker sDir = oFilePicker.getDisplayDirectory .Initialize( sFPservice() ) .SetDisplayDirectory( sDir )

REM ### active la case à cocher ### .SetValue( com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, 0, True) end with

if oFilePicker.execute() then 'traitement end if

end sub