I was toying with adding an extension on to the exported macro save file
but hadn't looked into using filters yet, so this is a help!
You should take a look at AndrewBase.odt. I have a very similar example
there, where you pass in a boolean to tell it to use "save" or "open".
Also, it initializes the file filters differently. Consider these two
functions:
Function OOoBaseFilters()
OOoBaseFilters() = Array("All Files", "*.*", _
"OOo Base", "*.odb")
End Function
Function GraphicFilters()
GraphicFilters() = Array("All Files", "*.*", _
"Graphic Interchange Format", "*.gif", _
"Joint Photographic Experts Group", "*.jpg", _
"Tag Image File Format", "*.tif", _
"Windows Bit Map", "*.bmp", _
"Gimp Files", "*.xcf", _
"Portable Network Graphics", "*.png")
End Function
Notice that this include a description and a file spec. Now, notice how
I set the filters
For i = LBound(sFilters()) To UBound(sFilters()) Step 2
Dim sFilterName$
Dim sFilterValue$
sFilterValue = sFilters(i+1)
sFilterName = sFilterValue & " - " & sFilters(i)
oDialog.appendFilter(sFilterName, sFilterValue)
Next
This uses both the description and the filter (wildcard).
2) I want to use a FilePicker to specify a file to save to, but
it's not possible to specify a file that does not yet exist with
the FilePicker, and I've gone through all the interfaces a
FilePicker has and look at all the dialogs that seem fitting for
this. I want to be able to either pick an existing file or specify
a new one, the same way it's possible when saving a document for
the first time or when picking "Save As." For now I have to use a
FolderPicker, get a folder, then ask for the file name with an
InputBox.
Is there some way to get a full path from a FilePicker to a file
that will be created but does not exist yet
Set it as a Save dialog. As an open dialog, you should not be able to
open a non-existing file
set this immediately after creation...
oFileDialog.Initialize(Array(com.sun.star.ui.dialogs.TemplateDescript
ion.FILESAVE_SIMPLE))
Other options for the templates are here:
http://api.openoffice.org/docs/common/ref/com/sun/star/ui/dialogs/Tem
plateDescription.html
Okay -- that makes sense. I had gone through looking at dialogs and
searching the API index under different letters that might have a
different FilePicker or FileSavePicker or SaveFilePicker or anything
like that and just couldn't find a darned thing!
It works just fine!
Thanks, Andrew.
Hal
Your welcome.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]