Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2013, 09:11 AM
bakhesh bakhesh is offline Making a macro run for each page in a mailmerge Windows 7 64bit Making a macro run for each page in a mailmerge Office 2007
Novice
Making a macro run for each page in a mailmerge
 
Join Date: Sep 2013
Posts: 2
bakhesh is on a distinguished road
Default Making a macro run for each page in a mailmerge

Hello,

Bit of a newb here, so apologies if this is a dumb question.

I've set up a mailmerge, and its all working fine, but part of the document is a table. I've flattened my data, so that I have fields for row1, row2 etc, but what I would like to do is hide the rows in the table if they are not populated.

I've written a macro which removes the borders of each row of the table, if the cells aren't populated, but I'm struggling to make it call. I want it to run after each page of the mailmerge is created but before the document is sent to print.

Googling the problem brings up a lot of people trying to run a mailmerge from a macro, but I can't find many people trying to run a macro from a mailmerge



Is this possible?
Reply With Quote
  #2  
Old 09-29-2013, 07:58 PM
macropod's Avatar
macropod macropod is offline Making a macro run for each page in a mailmerge Windows 7 32bit Making a macro run for each page in a mailmerge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi bakhesh,

Unless your macro runs the whole mailmerge process, it's not going to intercept the print function.

One alternative is to use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
http://windowssecrets.com/forums/sho...merge-Tutorial
or
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

For some worked examples, see the attachments to the posts at:
https://www.msofficeforums.com/mail-...html#post23345
https://www.msofficeforums.com/mail-...html#post30327

Another alternative is to use one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or
Doug Robbins at https://skydrive.live.com/?cid=5aedc...615E886B%21566
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a macro run for each page in a mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 8 02-11-2013 04:40 AM
Making a macro run for each page in a mailmerge Need help making a macro to space images brewsta Word VBA 3 12-11-2012 03:29 PM
Making Tables Copied from Excel Fit to Page joatmon Word 1 05-30-2012 08:47 AM
Making a macro run for each page in a mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 13 05-29-2012 02:04 PM
Making a macro run for each page in a mailmerge Making items (text, pictures, etc.) static on page Jeremiahts Word 3 04-07-2011 09:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft