Hi everybody,
Hi Frank,
I'll try to be knapp und klar :)
I was asked how to open a form that OOo couldn't open after rename it.
The problem was that the user renamed it (main app. window, right mouse
click) using a slash "xxx/yyy" character.
Obviously OOo tries to open it by hierarchical name, looking for a
folder with the name before the slash "xxx/" and a form (doc.
definition) named "yyy".
After some testing, I've realize that
* when we create a form in design view, and try to store it, if we use a
slash in its name [a] if the folder does not exists, OOo shows a message
that there is no folder with this name; [b] if the folder exists, OOo
saves the form named by the user "xxx/yyy" in the folder xxx under the
name yyy
* when we rename a form in the application main window, with a right
mouse button click: option "Rename", the dialog "Rename to" DOES NOT
prevent the user from renaming it with a slash "/". So, if the folder
does not exist: [a] OOo can't open the form (message: "the document
"xxx/yyy" could not be open"), [b] it is IMPOSSIBLE to rename again in
order to fix the problem, OOo shows in this case no explanation
Of course, with a little macro using com.sun.star.sdbcx.XRename ::
rename( NewName string)(*), the problem is fixed in a second; BUT the
common user who has no macro knowledge at all should be prevent from
renaming a form with a slash character.
I hope I was knapp und klar, if not, please check the ODB. I send you a
copy of this mail with an ODB to your personal mail
Should I suggest a fix?
Thanks
Ariel Constenla-Haile.
(*)
Sub Rename_a_Doc_Def
oDBContext = createUNOService("com.sun.star.sdb.DatabaseContext")
oDataSource = oDBContext.getByName(convertToURL(( "E:\mydb.odb" ))
oDatabaseDocument = oDataSource.DatabaseDocument
oDocumentContainer = oDocBASE.getFormDocuments()
oDocumentDefinition = oDocumentContainer.getByName("form/name")
oDocumentDefinition.rename("form_name")
End Sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]