Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining different Mail Merge Word files and generate into 1 pdf file

Status
Not open for further replies.

derricklo1980

IS-IT--Management
Jul 9, 2012
11
HK
Hi,

I want to write a VBA/macro to combine several Word mail merge files and save as 1 pdf file as an output.

Basically, I have a few Word template letters, each with a data source excel file (i.e. n Word files & n Excel files). For each Word template letter, it will have several records (and thus letters) depending on the number of records in its associated Excel file. I want to print all of these letters (from different Word Templates) either in simplex or duplex, and save as 1 single PDF file.

How to do it?
Thanks!
 
hi,

Please post your code, and explain where you are stuck.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Skip,

I'm a newbie in VBA. I know how to mail merge a Word template using a data source Excel file and print all the letters of that Word template out. But I have no idea how to (if the concept is right..) call a Word template, mail merge by calling its excel file, save the letters into a temp file; call another Work template and Excel file, save and append those letters to the end of the temp file; repeat the process and eventually got a combined file with all the letters of different templates and save as a PDF file...










 
Do you simply want free code, or are you looking for help doing VBA codeing?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Skip,

If there is code example would be great. If not, I would like to know if my idea work. In particular, I really have no idea how to achieve combining different Word templates' letters into 1 PDF file. Do you have any hints?

Thanks!
 
If you develop a VBA application, you have to be able to maintain it: not the usualy way for a novice to proceed!

I would begin IN WORD, not VBA, and work out a METHOD to accomplish exactly what you need to do. THAT is where you need to start. Forum68 can provide tips regarding MS Office application issues. This Forum707, provides tips regarding VBA coding. It makes the most sense to begin in the Office application, without code, to determine EXACTLY what process works.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Personally I stay out of Word VBA it is cumbersome. you mentioned Excel as a data source I would start your newbie app in there. let it control Word. And if you learn VBA I know it will make your data manipulation in Excel a lot more efficient.
With Excel you need to save your code in the personal.xla(x) [extension depends on version or Excel].
Why? because when you open Excel all your code will be there and waiting and not inside each individual sheet. So what? well if you create a button on the tool bar to run your new macro it will be looking for it in the .xla file and not in another sheet which you don't have open.

Oh yes always tell us what version you are using because the VBA changed in some regards.
But with any of the VBA you have to set it up first.
you have to turn on the "developer" tab and again; thank you Microsoft depending on which version you have its different. even from 2007 to 2010.
Keep in mind Excel can control Word or anything using VBA. I use both it and Access.

And... last but not least welcome to the new world of programming. your life will change forever when you can wip out er (better yet, grind and beat out) a "macro" that can do what used to take hours or even days of copying and pasting, will be 1000's time faster. the agony of making the macro will be "click your button and the screen flickers an bingo it's all done".

"IF" you want to do this, then you need to...
1. turn on the developer tab
2. get to know how to add macro buttons to your "quick access bar"
3. tell us which version of "Office" it is.
4. bring us a code snippet as a starting point




DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top