Using WordMerge Solution

Using WordMerge Solution

Hello all,

I'm trying to use the word merge solution but I'm having some problems cause i don't understand it well, not the solution itself but how can I use it in my specific case.

The problem is the following, I have an extension that has some templates in them, those templates are word documents.

i need based on pressing a button to merge the info to a specific document, but the problem is that i have no idea how to go and get the binary data that correspond to the document itself.

I've made an example based on the PopUpErrorMsg espace, and adapted it to show you my problem, or what i think is my problem.

I'm kind of new to the OutSystems methodology so if you see something really wrong in there, I'm sorry :)
the template extension itself
Hi Miguel,

Here are the steps that will let you do what you want:
1 - On the extension double-click the the 2 files and change the "Deploy Action" property to "Copy to Application directory"
2 - Publish the Extension
3 - In your eSpace, click "Add/Remove References" and add a reference to the RichMail Extension and add the HttpBinaryGet action
4 - Use that action to retrieve the files that should have been deployed in your application directory

Let me know if you need further assistance.

Tiago Simões
thanks for the help

i think that it's working by now, but i will try it latter, cause i don't have the MSWord installed on the server so i'm getting this error.

Merger Code:1001
Message Error: Could not launch MSWord COM

ps: in the attachment my final trial version, maybe someday it can be useful to somebody
i still had some problems but now it's working fine.

i dind't know that the record passed to the word merge had to have the exact same names as the word merge fields
Hey there, just recovering my on topic to have a quick question, maybe someone, has an answer for me:

I'm having this error when using word merge:

Word cannot give a document the same name as an open document. Type a different name for the document you want to save. (C:\WINDOWS\TEMP\tmpCEE1.tmp.doc)
Hi Miguel,

I had exactly the same problem as you and after some investigation I figured out what's happening. For some reason (I don't know which) your merge operation in MSWord is generating errors. As a result, the WordApp.MailMerge operation executed in the extension opens not one, but two files (something like "Letter1.doc" and "LetterGenerationErrors1.doc" - the names are not exact). Well, the fact is that the WordMerge extension is not prepared to have two open files after the merge operation, as it tries to save all the resulting files with the same name - i.e. it'll only work if there is one resulting file only.

The moral is, there is a problem in the WordMerge code, but the real origin of the problem is the fact that in your template/data files you have some kind of problem. In my case, I remade my template and the problem was solved.

You could try executing the mail merge operation manually so that you can figure out what's happening.

Best Regards,

Daniel Lourenço
you where rigth.

the problem here was because we had a table box inside a text box

it was either that or the fact that some pictures where not in front of the text.

but now it's working.


Can you tell me if wordmerge works fine with Vista and MSOffice 2008?

Hi Ivan,

I guess you are talking about Microsoft Office 2007, since Microsoft Office 2008 is only for Mac. Although I have not tested it yet, wordmerge should work correctly with Microsoft Office 2007 and Windows Vista. Are you having any problems?
Tiago Simões
Hello Tiago,

Yes...I got the following error:

System.NullReferenceException: Object reference not set to an instance of an object. at OutSystems.NssWordMerge.CssWordMerge.MssMailMerge(Byte[] ssWordTemplate, Byte[] ssExcelData, Boolean ssRepeatInPage, Byte[]& ssMergedDoc, Int32& ssErrorCode, String& ssErrorMessage) at OutSystems.NssWordMerge.CssWordMerge.MssMailMerge(Byte[] ssWordTemplate, Byte[] ssExcelData, Boolean ssRepeatInPage, Byte[]& ssMergedDoc, Int32& ssErrorCode, String& ssErrorMessage)

Can´t see why.

Thanks for your help.

Hi Ivan,

I'am in the same situation as you where.
"System.NullReferenceException: Object reference not set to an instance of an object....."

Did you solve this? and can you tell me how?


Best Regards.

I'm trying used the MergeDoc action from WordMerge extension.
In the "WordTemplate" input parameter I put de Content of my word template document. I want replace a word "@date" from the template document to CurrDate(), but I don't know what I put in the WordData input parameter!!

Does anyone have an example?

Hi Cristina.

I'm not sure that you are using the component right.

The Word Merge Extension provides Actions to merge a Word document template with another Word document or with an Excel document. In this case, the action you're using merges one Word document with a second Word document.

The parameters for that action are the following:

WordTemplate - Binary content of the Word document template.
WordData - Binary content of the Word document whose content will replace the string TextToReplace in the template.
TextToReplace - Text to be replaced by the new Data. If this is empty or is not found in the template, the Word data will be added to the beggining of the template document.

The solution does have a sample eSpace, called "WordMergeSample". The screen you're looking for is the WordMergeDocScreen, which you can access in runtime through your browser, and try out the action for yourself.

Remember that you need to have Microsoft Word installed in the server, in order to run this sample.

Let me know if this helps.R


Paulo Tavares
hello all,

I'm trying to use the WordMerge Extension

and I have 2 question:

is it possible to merge .txt (WordData) with .docx (WordTemplate)?

what is the possible raison for the MergeDoc action to generate the empty output (MergedDoc)? the attachment see my exemple to use the MergeDoc

thanks you