Re: [api-dev] Registering an XMailMergeListener - possible at all?

2007-03-02 Thread Christian Lohmaier
Hi Marc, *,

On Mon, Feb 19, 2007 at 06:32:12PM +0100, Marc Santhoff wrote:
 Am Montag, den 19.02.2007, 15:43 +0100 schrieb Christian Lohmaier:
  [mailmerge-listener]
  If I cannot use the builtin wizard, but have to ask the user for the
  desired Database, etc myself and have to start the mailmerge from within
  my extension, then this would be far too much effort and thus pretty
  useless to me.
 
 You could search the archives of this list for:
 
  From [EMAIL PROTECTED] Mon Sep 27 14:43:34 2004
  Subject: Re: [api-dev] mailmerge api usage
  Message-id: [EMAIL PROTECTED]
 
 There you can find a complete working example of doing MailMerge written
 in Java. If it is not on the list please tell me, I'll forward it to
 you.

I think I found the mail you're refering to, but unforutnately it
doesn't use the wizard-functionality, but instead requests the
database/table to use in the merge as arguments.
http://api.openoffice.org/servlets/ReadMsg?listName=devmsgNo=11328

 From having a quick look at the code at least the setup of a database
 connection is shown, too.

Yes, but this still would require me to write code to ask the user for
the requested database and to duplicate all the stuff the current
mail-merge wizard has builtin. (I personally don't like the wizard at 
all, but I don't want to write one myself either)

 [...]---
 
 % java MailMerger -merge URL of template file Data Source name Table 
 name

I don't want to deal with selecting the datasource/table at all. I only
want to replace either a field or a bookmark/placeholder in the
merge-document before it is printed/saved.

 /---
 
 So it shows much more than doing MailMerge ...

Yes, it shows how one could do this, but I want to avoid all this...

I think I'll just tell the user to use the modify document button and
then run the macro.

Not perfect, but still far easier than setting up a mail-merge from
scratch.

ciao
Christian
-- 
NP: The Smashing Pumpkins - Porcelina Of The Vast Oceans

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Registering an XMailMergeListener - possible at all?

2007-03-02 Thread Marc Santhoff
Moin Christian,

Am Freitag, den 02.03.2007, 16:09 +0100 schrieb Christian Lohmaier:
 Hi Marc, *,
 
 On Mon, Feb 19, 2007 at 06:32:12PM +0100, Marc Santhoff wrote:
  Am Montag, den 19.02.2007, 15:43 +0100 schrieb Christian Lohmaier:
   [mailmerge-listener]
   If I cannot use the builtin wizard, but have to ask the user for the
   desired Database, etc myself and have to start the mailmerge from within
   my extension, then this would be far too much effort and thus pretty
   useless to me.
  
  You could search the archives of this list for:
  
   From [EMAIL PROTECTED] Mon Sep 27 14:43:34 2004
   Subject: Re: [api-dev] mailmerge api usage
   Message-id: [EMAIL PROTECTED]
  
  There you can find a complete working example of doing MailMerge written
  in Java. If it is not on the list please tell me, I'll forward it to
  you.
 
 I think I found the mail you're refering to, but unforutnately it
 doesn't use the wizard-functionality, but instead requests the
 database/table to use in the merge as arguments.
 http://api.openoffice.org/servlets/ReadMsg?listName=devmsgNo=11328

But at least it showshow this stuff is expected to work.

  From having a quick look at the code at least the setup of a database
  connection is shown, too.
 
 Yes, but this still would require me to write code to ask the user for
 the requested database and to duplicate all the stuff the current
 mail-merge wizard has builtin. (I personally don't like the wizard at 
 all, but I don't want to write one myself either)

Okay, thinking about it two ideas come to my mind:

1. Hacking up^w Improving the wizard

The sources should be somewhere near the database wizard. That is found
here:

http://installation.openoffice.org/source/browse/installation/wizards

It could be a nice feature to have ... although I don't know if there is
something similar in other countries or if this would be german only.

2. Trying to use one of the event hooks at the document in process

There is an event Serienbriefe drucken, or maybe Dokument drucken
will fit your needs. I think you could hook to one of them and trigger
your macro there.

The only question left then is, whether the hook is called only once at
the start of mail merging or for each document with the actual data
merged in already.

HTH,
Marc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]