OpenDocument4all - Info and tools about OpenDocument
Sunday, 05 February 2012
Home arrow Forum
Forum Statistics
Total user: 89
Total message: 179
Main Menu
Home
My Blog
AODL - Project
AODC - Project
OO Development & Info
Forum
About OpenDocument ...
Search
News
Contact Us
Login Form





Lost Password?
No account yet? Register
Sourceforge.net

SourceForge.net - Goto the project homepage
Project site on SF.net

 

Demand OpenDocument

 

Countomat Webcounter und Webstatistik (Statistik & Logfileanalyse, Counter)

OpenDocument4all-Forum

 
Bug with Writer User Field replacement in C#
Date: 2008/07/11 22:22 By: Dave Status: User  
Karma: 0  
Fresh Boarder

Posts: 1
graphgraph
Hi,

I am very nearly there with a field replacement but I have a compile error.

I am converting some example Java code from the forum and wondered if there is anything obvious that I am doing wrong here....

I'm using the DLL's supplied with OpenOfficeLib.

Code:

  using unoidl.com.sun.star.lang; using unoidl.com.sun.star.uno; using unoidl.com.sun.star.beans; using unoidl.com.sun.star.bridge; using unoidl.com.sun.star.frame; using unoidl.com.sun.star.text; using unoidl.com.sun.star.container; ...          XComponentContext localContext uno.util.Bootstrap.bootstrap();          XMultiServiceFactory multiServiceFactory = (XMultiServiceFactory)localContext.getServiceManager();          XComponentLoader componentLoader = (XComponentLoader)multiServiceFactory.createInstance("com.sun.star.frame.Desktop");          // PathConverter swaps the slashes and makes a url.          string filename Component.PathConverter(path); //          // Hide Open Office //          PropertyValue[] propertyValue = new PropertyValue[1]; //          PropertyValue aProperty = new PropertyValue(); //          aProperty.Name = "Hidden"; //          aProperty.Value = new uno.Any(true); //          propertyValue[0] = aProperty;          PropertyValue[] propertyValue = new PropertyValue[0];          XComponent xComponent componentLoader.loadComponentFromURL(filename"_blank"0propertyValue);          // get XTextFieldsSupplier, XBookmarksSupplier interfaces          XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)xComponent;          XNameAccess xNamedFieldMasters xTextFieldsSupplier.getTextFieldMasters();          XEnumerationAccess xEnumeratedFields xTextFieldsSupplier.getTextFields();          // Compile Error here.          // error CS0029: Cannot implicitly convert type 'uno.Any' to ' unoidl.com.sun.star.beans.XPropertySet'          XPropertySet propertySet xNamedFieldMasters.getByName("com.sun.star.text.FieldMaster.User.Company");          




error CS0029: Cannot implicitly convert type 'uno.Any' to 'unoidl.com.sun.star.beans.XPropertySet'

Any takers ?

Dave.
The administrator has disabled public write access.

Quick jump
Download area
Who's Online
We have 28 guests online
Polls
Should AODL and AODC also implement export as PDF and RTF?
 
Popular
© 2005 MamboZ. All rights reserved.