I found a solution myself for the filepicker dialogs started from the
API using the invalueable "oleService.createInstance" and some scriting
(found on the web) based on the 'Wscript.shell"
Sub test( )
Dim oleService , wso
Dim sFilePickerArgs
sFilePickerArgs =
Array(com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE)
'FILESAVE_AUTOEXTENSION)
dlgFile = CreateUnoService ("com.sun.star.ui.dialogs.FilePicker")
with dlgFile
.Initialize(sFilePickerArgs())
.SetMultiselectionMode (false)
.Title = "Kies Attachement"
.setDisplayDirectory(ConverttoURL(spath ))
END with
sSluitpicker = dlgFile.Execute ()
If sSluitpicker = 1 Then
Dim selFiles() As Object
selFiles = dlgFile.GetFiles()
sFilePath = convertfromurl(selFiles(0))
END If
If sSluitpicker = 0 Then
exit sub
endif
if ucase( right(sfilepath,4)) = ".LNK" then ' it's a Shortcut
'-------handeling the LNK files-----------
oleService = createUnoService("com.sun.star.bridge.OleObjectFactory")
wso = oleService.createInstance("Wscript.Shell") ' is pressent on every
Windows machine
shortcut= wso.CreateShortcut(sFilepath)
print shortcut..targetpath
endif
print "Normal filepicker procedure"
End Sub
I supose i can file a enhancement issue for the GUI dialogs , peace off
cake for a real developer ?
Greetz
Fernand
Cor Nouws wrote:
Hi Fernand,
Fernand Vanrie wrote (16-3-2009 18:24)
I forced the users off my macro's to use OO-dialogs instead off the
Windows dialogs. I found out that they go back to uses Windows
dialogs because their Windows "Shortcuts" do not functions in
OO-filepicker dialogs. OO show this dialogs als "LNK-files" who lost
their shortcut (link) capacities.
Can this behavior been solved ?
I don't know.
However, I picked up this tip from Frank Schönheit: you can add your
own paths to the home-icon (top left), which will then have an arrow.
Do this by adding the environmental variable "PathFavourites" to your
system. Steps for Windows:
- This computer
- Advanced
- Environmental variables
- New ... Name "PathFavourites" ... value: the full paths separated
by ";".
This can be part of a work around, maybe?
Cor,
Thanks for this Tip, is see if i can code this PathFavourites just
before opening a filepicker and add the favourites depending on the
User and the function he has in our compagny.
Groeten
Fernand
vr. groet,
Cor
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org