Joined: 15 Jun 2005
|Posted: Tue Jun 21, 2005 2:42 am Post subject: Need Mailmerge resultfiles with text instead of fields
|I use a MySQL Dataabase at source.I have somedatabasefields and some conditional field in the letter And create the lettes per macro. Everything fine so far.
When I open the letter everything works fine. As soon as i click onto the send per email as pdf button, the conditional field always shows the ELSE case. If I reinsert the data by Hand using the DB functions it shows the right result again. I tried to use the syntax: "[database.query.field]" aswell as "field", both work with the mailmerge, both end with the wrong case.
I submitted a bug report allready. I think, this is a bug, I can reproduce it with diffrent querys and documents.
How can I work arround this problem?If I create a mailmerge by hand the result letters are text only and don't include any field. My code always creates letters with all fields which is not necerccery here is my code:
| Dim oProps as Object
oPathSettings = CreateUnoService( "com.sun.star.util.PathSettings" )
oMerge = createunoservice("com.sun.star.text.MailMerge")
oMerge.DocumentURL = ConvertToUrl(DocPath & "letter.odt")
oMerge.DataSourceName = "mydatabase"
oMerge.CommandType = 1
oMerge.Command = "MyQuery"
oMerge.OutputType = 2
oMerge.OutputUrl = ConvertToUrl(DocPath)
oMerge.FileNameFromColumn = False
oMerge.Filenameprefix = "mymergedletters"