openjack wrote:

> 
> Mathias Bauer wrote:
>> 
>> So to change toolbar states you must intercept the status updating
>> procedure. Unfortunately this is not possible using any Basic, neither
>> OOo nor VB. You have to use a programming language that allows to
>> implement UNO objects (C++, Java, Python).
>> 
> 
> I'm really sorry because MAYBE I'm reading a different suggests... I don't
> know If I'm reading good, but my understanding is that I can't hide
> toolbar's button from VB .NET, but Jurgen said "Everythig you do in the
> macro can be done from VB.Net directly and it is possible to disable
> commands." and I can hide Print and Save button from toolbar with a OOBasic
> macro, as I show in my first post.

You are reading quite well. Your error is the assumption that the OOo
Basic code you presented is the right approach. ;-)

As I said, direct manipulation of toolbar buttons using the toolkit API
is not recommended and won't work reliably as internal status update
processing permanently can override your attempt to force a particular
button status.

>> The only case where you can do this without implementing objects is when
>> you want to disable a certain command *all the time*. This is possible
>> with using a simple configuration file, not code is needed.
>> 
> 
> Anyway, I need to hide or disable some functions, like Print or SaveAs. The
> requirement is to show the content of the ODT file, and don't need to Print
> or Save.

So you can put ".uno:Print", ".uno:PrintDirect", ".uno:Save" and
".uno:SaveAs" into the list of DisabledCommands and they will be
automatically disabled without writing any code. IIRC this should be
described in the Developer's Guide. If not, please ask again.

You can even remove the toolbars completely in case you just want to
"view" a document.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to