Hello Alexander

This pseudo-property is read only, so changing it isn't allowed.
But you can use something like this : 

option explicit

sub main

        dim doc as object
        dim docUrl as string
        dim controller as object
        dim args(0) as new com.sun.star.beans.PropertyValue
        
        doc = thisComponent
        docUrl = doc.url
        if (docUrl <> "") then
                controller = doc.currentController
                if (not isNull(controller)) then
                        args(0).name = "AsTemplate"
                        args(0).value = true
                        doc = controller.frame.loadComponentFromUrl(docUrl, 
"_self", com.sun.star.frame.FrameSearchFlag.SELF, args())
                        doc.setModified(true)
                end if
        end if  

end sub

Regards,
Thibault Vataire


----- Mail Original -----
De: "Alexander Anisimov" <[email protected]>
À: [email protected]
Envoyé: Mardi 25 Mai 2010 18:42:48
Objet: [api-dev] How to set URL property of ThisComponent to ""

Hello,

I write a macro in OO Basic, which must be executed when loading the
document. In a macro I want to set the property URL="" to where within
the document, the user clicked  "Save" or "Ctrl + S", then OpenOffice
introduced itself as whether the user edits are not saved before
document. That is, when you first click on "Save" or "Ctrl + S" should
appear in the window to request the file name to save document.

Does anyone know how to do it?

Thanks in advance
-- 
-- 
.''`.   With best regards,
: :' :  Alexander Anisimov
`. `'   JID [email protected]
   `-    Debian - when you have better things to do than fixing systems

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to