| View previous topic :: View next topic |
| Author |
Message |
Miki Guest
|
Posted: Tue Apr 20, 2004 2:49 am Post subject: Macro for save as dialog box |
|
|
HELLO!
I have to write a macro, for a save as dialog box. It should works in that order: I prees the button, then a dialog box ask me where to save a file and what type.
Anybody can help?
TNX |
|
| Back to top |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Tue Apr 20, 2004 8:31 am Post subject: |
|
|
If you just want to get the normal Save File Dialog.
Then it's as simple as that to get it:
| Code: |
Sub filepickerdialog()
Dim oFileDialog
oFileDialog = CreateUnoService( "com.sun.star.ui.dialogs.FilePicker" )
oFileDialog.execute()
End Sub
|
Does that answer your question? _________________ - Knowledge is Power - |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Tue Apr 20, 2004 8:56 am Post subject: |
|
|
The FilePicker service does not save a dialog. It is to prompt the user to select an existing file, and then give you (the programmer) back the pathanme of the file the user picked.
You might use FilePicker on a macro dialog box that had a "Browse...." button that the user picks to bring up a FilePicker to select the pathname of a file.
| Code: | Sub Main
oDoc = ThisComponent
oDocCtrl = oDoc.getCurrentController()
oDocFrame = oDocCtrl.getFrame()
oDispatchHelper = createUnoService( "com.sun.star.frame.DispatchHelper" )
oDispatchHelper.executeDispatch( oDocFrame, ".uno:SaveAs", "", 0, Array() )
End Sub |
_________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Tue Apr 20, 2004 10:11 am Post subject: |
|
|
use Danny's code ! _________________ - Knowledge is Power - |
|
| Back to top |
|
 |
Miki Guest
|
Posted: Tue Apr 20, 2004 11:04 pm Post subject: Re: Macro for save as dialog box |
|
|
| Thank you DannyB! |
|
| Back to top |
|
 |
|