Ideas for attaching a word file in a document

I need to create a word file using MS Word’s mailmerge feature. Need to combine the word doc contents and notes document fields to create a new word file and attach it in a new notes document. I am thinking of doing the following…

Please advise if this is possible or if there is a better way to do it.

  1. Get a word(mailmerge template) document attached in a configuration/lookup document

  2. Extract to a temporary directory

  3. open the file and apply mail merge and save it in the temp directory

  4. Attach that in a newly created document

Thanks

Subject: Ideas for attaching a word file in a document

You can download an example here

http://www.nappz.de/xfl/download.htm

The last of your points is not implemented in this script. But this should not be a problem. Add code like this to store the new word file in a notesdocument

…

dim newdoc as new notesdocument(db)

Set body = doc.CreateRichtextitem(“Body”)

Call body.embedObject(EMBED_ATTACHMENT, “” , filename)

Call doc.save(True,True)