Tobias Krais wrote:
Hi together,

is it possible to pass a String when calling a CommandURL?

I added a menu item with a self written CommandURL. When I click on the
item, I would like to pass a String like "Hello world!" to the
CommandURL. Is that possible?

Hi Tobias,

I don't exactly know what you want to do. Do you want to pass arguments to a command that you want to dispatch?

Something like:

Sequence< beans::PropertyValue > aArguments(1);
com::sun::star::util::URL aURL;
aURL.Complete = ".uno:Open"

xURLTransformer->parseStrict( aURL );

aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" );
aArgs[0].Value = uno::makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "file:///home/test/test.odt" )) );

xDispatch->dispatch( aURL, aArgs )

There is also a way to pass simple types via the URL. Keep in mind that you have to escape certain characters (e.g. ?,&,' ',...) if you use them in your arguments.

command?arg1:type1=value2&arg2:type2=value2

".uno:Open?FileName:string=file:///home/test/test.odt"

Regards,
Carsten

--
Carsten Driesner (cd) - Project Lead OpenOffice.org Framework
Framework wiki: http://wiki.services.openoffice.org/wiki/Framework
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

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

Reply via email to