Benjamin Vollmer wrote:
Hello,

I want to learn how to develop extensions for OOo Writer. So I read the basic chapters in the Developers Guide and set up a developing environment with Netbeans 6.1 + OOo Plugin, OOo3 and SDK. Then I followed successfully this tutorial http://wiki.services.openoffice.org/wiki/OpenOffice_Add-On_Project_Type to create an sample add-on.

For the next learning step I invented some sample requirements which should be implemented. The extension should have 2 commands in his toplevel menu, one for a simple text conversion (e.g. rot13 or something like that) and one for a dialog where I want to add some specific metadata to the odf file (something like what is described here http://blogs.sun.com/GullFOSS/entry/custom_properties_and_fields).

My first problem is that I don't know how to get the connection to the opened odt file and his contents.
OK: when using OObasic the openend odt file is "thiscomponent" and access to custom-userfields is done like:
       oDocument = thiscomponent
       oDocuInfo = oDocument.DocumentInfo()
if not oDocuInfo.PropertySetInfo.HasPropertyByName("yourfieldname") then
         "your_value"
         oDocuInfo.AddProperty("Yourrfieldname",0,"your_value")
         else
         oDocuInfo.setPropertyValue("Yourfieldname" , "your_value")

and oDocuInfo.getPropertyValue("Yourfieldname" )  gives us the stored value

hope it helps

Fernand



Regards
Benjamin


---------------------------------------------------------------------
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