On Wed, 2005-06-01 at 10:14 +1200, Ian Laurenson wrote:
> Reply in-line.
> 
> On Wed, 2005-06-01 at 02:04, G. Roderick Singleton wrote:
> > On Tue, 2005-05-31 at 18:57 +1200, Ian Laurenson wrote:
> [snip]
> > > I have put the macro code and a slightly revised version with some
> > > comments here:
> > > http://ext.openoffice.org.nz/doku.php?id=collaboration:mail_merge
> > > 
> > > However, I have not been able to get it to work.
> > > I get the message "Failed to connect to mail server..".
> > > 
> > > I have tried 1.9.100 for Linux and Windows (Windows2000).
> > > 
> > 
> > I have looked but am confused. What are the prerequisites for using the
> > snippet? 
> > 
> As I haven't been able to get it to work I am uncertain. Somehow OOo
> needs to "know" how to connect to the mail server ????
> The Source database needs to be registered.
> 
> > Another question, why does the code as it sits appear to duplicate using
> > the letter mailmerge wizard (AutoPilot) What I was expecting was
> > something like this (pseudo code)
> > 
> >      1. Extract email address and other fields from database
> I think the following portions of code deal with this:
> 
> 'Create the service
> xMailMerge = createUnoService("com.sun.star.text.MailMerge")
> 
> 'Specify the datasource which I think needs to be registered (but haven't 
> checked)
> xMailMerge.DataSourceName = "Bibliography"
> xMailMerge.CommandType = com.sun.star.sdb.CommandType.TABLE '0
> xMailMerge.Command = "biblio"
>  
> 'Specify that it is to be a e-mailmerge
> xMailMerge.OutputType = com.sun.star.text.MailMergeType.MAIL '3 ' 1:print; 
> 2:file; 3:mail;
> 
> 'Define other properties for the service that relate to the e-mail
> xMailMerge.Subject = "My subject"
> xMailMerge.AddressFromColumn = "Address"
>  
> 'Define the source document ???
> xMailMerge.DocumentURL = thisComponent.URL      'Not in original but I think 
> it is necessary
>  
> xMailMerge.SendAsAttachment = true
> xMailMerge.SendAsHTML = false   'If SendAsAttachment this shouldn't be 
> necessary
>  
> xMailMerge.MailBody = "My body" 'Property only valid if SendAsAttachment = 
> true
>  
> xMailMerge.AttachmentName = "My attachment"
> xMailMerge.AttachmentFilter = "writer_pdf_Export"
> >      2. Prepare body of message with personalization
> I'm assuming that this would be handled by having fields in the document
> 
> >      3. Send message to email address that was extracted above.
> > 
> xMailMerge.execute(array())
> 
> > Am I reading the code wrong?
> As I haven't been able to get it to work - I don't know.
> 
> I put it onto the site for discussion, and hopefully someone brighter
> than me might find a solution.
> 
> Thanks, Ian

Thanks rather to you for your answer. Cleared up a bunch for me.

Thanks,
-- 
PLEASE KEEP MESSAGES ON THE LIST.
OpenOffice.org Documentation Co-Lead
http://documentation.openoffice.org/ 


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

Reply via email to