One of my users has asked if I can set up some standard letters in Winword, and have a button on my nu record form to fire off an automatic mailmerge using that nu record's fields as merge source.
I started thinking about Javascript, as I can kick word off with some local code, but then don't think I can force a mailmerge to happen that way. (thinks - if I could start word with some parameters maybe I might be able to ?)
Or, I could use php to write a temporary mailmerge source file to the server and arrange for the local users machine to see that folder so they can get it that way.
Or I could write a temp mysql record and let that be a merge source via a word macro.
These all involve a bit of work and was wondering if any one else had done anything similar before I dive in too deep?
Thanks
Martin
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Mail merge using Winword
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: Mail merge using Winword
I'm not sure whether this will solve your problem, but it's worth a look
http://phpword.codeplex.com/
you can use it in the Add Activity Procedure section and call it anywhere with runIt('pCode').
zazzium
http://phpword.codeplex.com/
you can use it in the Add Activity Procedure section and call it anywhere with runIt('pCode').
zazzium
-
- Posts: 60
- Joined: Fri Oct 26, 2012 8:09 pm
Re: Mail merge using Winword
Hi,
Thanks for the pointer to phpword - looks cool.
I am in a small battle with folks here who think that a database should also manage mail merges (like FileMaker is so good at sadly!).
I don't agree and would prefer to use odbc link to excel as a source.
But - to humor my users am thinking of setting up a letter subform on the main person record where they can select several letter types to be printed. In a `lettertypes` record I'll include a few fields for sql statements as well as name and address fields and userid so that our managers can self define a few variables to be used in customised mail merges.
Then I could have an excel file with all the ms query in it pulling all available fields back but selecting per lettertype,
and then the letter type winword doc will link to the correct excel source (they will have the same name or something) and they can print away. And once printed they can run an activity which clears down all their own print requests.
Sorry not explained too well, if I get it working will post more details here - not sure when that will be just yet
But using phpword means I could include blocks of letter text in a letters record and then generate each letter as needed --- hm sounds intriguing.
But think I will come back to my view we should expect users to manage mailings themselves using the office products they prefer.
Undecided !
Thanks v much
Martin
Thanks for the pointer to phpword - looks cool.
I am in a small battle with folks here who think that a database should also manage mail merges (like FileMaker is so good at sadly!).
I don't agree and would prefer to use odbc link to excel as a source.
But - to humor my users am thinking of setting up a letter subform on the main person record where they can select several letter types to be printed. In a `lettertypes` record I'll include a few fields for sql statements as well as name and address fields and userid so that our managers can self define a few variables to be used in customised mail merges.
Then I could have an excel file with all the ms query in it pulling all available fields back but selecting per lettertype,
and then the letter type winword doc will link to the correct excel source (they will have the same name or something) and they can print away. And once printed they can run an activity which clears down all their own print requests.
Sorry not explained too well, if I get it working will post more details here - not sure when that will be just yet

But using phpword means I could include blocks of letter text in a letters record and then generate each letter as needed --- hm sounds intriguing.
But think I will come back to my view we should expect users to manage mailings themselves using the office products they prefer.
Undecided !
Thanks v much
Martin