This sample will open a specified document.

1. Install an OpenOffice.org. 
2. Start the office with the following parameter 
   out of the program directory.
   
   Windows :
   soffice -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager

   Unix :
   soffice '-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager'

   This lets the office accept on the localhost-port 8100.

   Alternatively, you can modify a configuration file.

   <officeinstall>share/config/registry/instance/org/openoffice/Setup.xml
   You need to modify the tag <code>ooSetupConnectionURL<code>.
   Please replace
   
   <ooSetupConnectionURL cfg:type="string"/>

   with
   
   <ooSetupConnectionURL cfg:type="string">socket,host=localhost,port=8100;urp;StarOffice.ServiceManager</ooSetupConnectionURL>

2. After starting the office, netstat -a | fgrep 8100 should signal,
   that the port is being listened to ). 

3. Building the example
   - Build this directory using gnumake
   - Make odkxxx/WINexample.out/bin your current directory
     (replace WIN by linux,solsparc for the other platforms).
      
4. Excecuting the example
   - Make odkxxx/WINexample.out/bin your current directory
     (replace WIN by linux,solsparc for the other platforms).
   - Now execute the following (for example) : 
     Windows :
     DocumentLoader.exe "uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" "private:factory/scalc"

     Unix : 
     DocumentLoader 'uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager' 'private:factory/scalc'

   - Customize the last parameter to your file to be loaded.
     eg. "file:///tmp/test.sxw"