|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
java MailMerger for open office 3.1.1Dear All: I am trying to play with the MailMerger java possibly written more than 5 years ago. I have not a few problems, possibly my open office is too new, version 3.1.1. 1. DataSource should be converted to XDataBaseDocument first before converted to XModel (Fixed). XDocumentDataSource xDocumentDataSource = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, dataSource); XOfficeDatabaseDocument xDatabaseDocument = xDocumentDataSource.getDatabaseDocument(); XStorable store = ( XStorable)UnoRuntime.queryInterface(XStorable.class, xDatabaseDocument); XModel model = ( XModel)UnoRuntime.queryInterface(XModel.class, xDatabaseDocument); store.storeAsURL("file:///C:/ToBeDeleted/Documents/test7.odb", model.getArgs()); /**** ABOVE is working ****/ 2. Failed with saving the template. /*************Follwing code does not work ****/ PropertyValue[] propertyvalue = new PropertyValue[2]; propertyvalue[0] = new PropertyValue(); propertyvalue[0].Name = "Overwrite"; propertyvalue[0].Value = new Boolean(true); propertyvalue[1] = new PropertyValue(); propertyvalue[1].Name = "FilterName"; //// Here I even changed the FilteName, it still does not working properly. //// Definitely I can use dispatcher to do "saveAs" propertyvalue[1].Value = "writer_StarOffice_XML_Writer_Template"; // Store the document xStorable.storeAsURL("///C:/ToBeDeleted/Documents/my.stw", propertyvalue); 3. Failed with the merging. /**** Following code does not work ****/ oObjProps.setPropertyValue("DataSourceName", mDataSourceName); oObjProps.setPropertyValue("Command", mTableName); oObjProps.setPropertyValue("CommandType", new Integer(com.sun.star.sdb.CommandType.TABLE)); oObjProps.setPropertyValue("OutputType", new Short(com.sun.star.text.MailMergeType.PRINTER)); oObjProps.setPropertyValue("DocumentURL", mFileURL); ///Exception throw at the above line 4. Failed with the XConnection to the datasource. We may need to add the connection to the text.MailMerger But it failed to get the connection. oObjProps.setPropertyValue("ActiveConnection", datasource.getConnection('', ''')); Anyone has the latest java MailMerger for Open Office 3.1.1? Many thanks for all your efforts and time. Best wishes, Ted _________________________________________________________________ Use Messenger in your Hotmail inbox Find out how here http://windowslive.ninemsn.com.au/article.aspx?id=823454 |
|
|
Re: java MailMerger for open office 3.1.1Hello Ted,
On Thursday 08 October 2009, 08:30, Ted Zhou wrote: > Dear All: > > I am trying to play with the MailMerger java possibly written more than 5 > years ago. as you didn't quote your source, I didn't know what you where talking about, but a little searching makes me think you're talking about http://codesnippets.services.openoffice.org/Writer/Writer.MailMerge.snip > Anyone has the latest java MailMerger for Open Office 3.1.1? well, not sure if this is the latest, but I've just finished it (== not very tested, so use it at your risk, only as a tool for further research) http://arielch.fedorapeople.org/devel/OOoMailMerge.zip > Many thanks for all your efforts and time. You're welcome; yo should also thank Cor, who pushed me into this ;-) @Jürgen: that snippet should be removed, because is rather misleading. I didn't look much at the source, but does not work anymore (not sure it ever did on something >= OOo 2.0). Regards -- Ariel Constenla-Haile La Plata, Argentina --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: java MailMerger for open office 3.1.1Ariel Constenla-Haile wrote:
> Hello Ted, > > On Thursday 08 October 2009, 08:30, Ted Zhou wrote: >> Dear All: >> >> I am trying to play with the MailMerger java possibly written more than 5 >> years ago. > > as you didn't quote your source, I didn't know what you where talking about, > but a little searching makes me think you're talking about > http://codesnippets.services.openoffice.org/Writer/Writer.MailMerge.snip > >> Anyone has the latest java MailMerger for Open Office 3.1.1? > > well, not sure if this is the latest, but I've just finished it (== not very > tested, so use it at your risk, only as a tool for further research) > > http://arielch.fedorapeople.org/devel/OOoMailMerge.zip > >> Many thanks for all your efforts and time. > > You're welcome; yo should also thank Cor, who pushed me into this ;-) > > @Jürgen: that snippet should be removed, because is rather misleading. I > didn't look much at the source, but does not work anymore (not sure it ever > did on something >= OOo 2.0). But it shows the problem with the snippets, they need some maintenance with QA as well. The APIs should work always ;-) but as we can see sometimes they don't. It might be a regression, a bad example (depending on impl details), or whatever... Juergen --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: java MailMerger for open office 3.1.1Juergen Schmidt wrote (14-10-2009 9:47)
> Ariel Constenla-Haile wrote: >> You're welcome; you should also thank Cor, who pushed me into this ;-) >> >> @Jürgen: that snippet should be removed, because is rather misleading. >> I didn't look much at the source, but does not work anymore (not sure >> it ever did on something >= OOo 2.0). > better would be to fix the snippet. Is there a volunteer? Both Ted and René are interested and took a look at the stuff. So .. ;-) Ciao - Cor -- Cor Nouws - nl.OpenOffice.org marketing contact - Community Contributor Representative in the Community Council Gevoel niet vrij te zijn? Zie www.nieuwsteversie.nl --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
| Free embeddable forum powered by Nabble | Forum Help |