Hey Marc,

Marc Santhoff schreef:
The merging sequence looks like this:

<snip>
public void doMerge() {

         Object mmservice = null;

         try {
             // Create an instance of the MailMerge service
             mmservice = mxMCF.createInstanceWithContext(
                 "com.sun.star.text.MailMerge", mxComponentContext);
         }
         catch (Exception e) {
             System.err.println("Error getting MailMerge service: " + e);
             return;
         }

         // Get the XPropertySet interface of the mmservice object
         XPropertySet oObjProps = (XPropertySet)
             UnoRuntime.queryInterface(XPropertySet.class, mmservice);

         try {

             // Set up the properties for the MailMerge command
             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.FILE));

             oObjProps.setPropertyValue("DocumentURL", mFileURL);

} catch </snip>
Yeah, well, that's exactly what I do. And the code passes, and runs fine, except that the resulting file doesn't have the fields merged. And then when I change MailMergeType.FILE to MailMergeType.PRINT I do get the merged document printed out...

Did you by any chance run this code on a OOo2.3 version?
If anything fails I can pack up the complete bunch of files and send
them to you in private.
Well I think I have roughly the same code as you have, since I too picked it up somewhere in the archives (even the comments match), but just to be sure it might be a good idea,
so yes please :)
HTH,
Marc
Cheers,

Willem

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