Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...On your site I feel quite confident that the contacts and feedback will make my life a little less hectic..."

Geography

Where in the world do Tek-Tips members come from?

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

derricklo1980 (IS/IT--Management)
9 Jul 12 10:23
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!
SkipVought (Programmer)
9 Jul 12 10:36
hi,

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

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

derricklo1980 (IS/IT--Management)
9 Jul 12 10:50
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...










SkipVought (Programmer)
9 Jul 12 10:57
Do you simply want free code, or are you looking for help doing VBA codeing?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

derricklo1980 (IS/IT--Management)
9 Jul 12 11:36
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!
SkipVought (Programmer)
9 Jul 12 11:45
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: Microsoft: Office can provide tips regarding MS Office application issues. This forum707: VBA Visual Basic for Applications (Microsoft), 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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

DougP (MIS)
14 Jul 12 6:06
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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close