Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2013, 01:39 PM
macropod's Avatar
macropod macropod is offline TextFields disappear during mail merge Windows 7 32bit TextFields disappear during mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Instead of trying to re-insert the formfields as each record is generated, via the MailMergeAfterRecordMerge event, you'd do better to wait until the merge has completed then re-insert the formfields for all records in a single pass - all you need is a placeholder for that, as the article in the link indicates.

As for values being lost, what you're doing suggests the formfields are not required after the merge - only their results. In that case, you could leave the formfields in the mailmerge main document but use a macro to convert them to their results before executing the merge. Just don't re-save the mailmerge main document after running the macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-01-2013, 05:48 AM
Cosmo Cosmo is offline TextFields disappear during mail merge Windows Vista TextFields disappear during mail merge Office 2007
Competent Performer
TextFields disappear during mail merge
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Instead of trying to re-insert the formfields as each record is generated, via the MailMergeAfterRecordMerge event, you'd do better to wait until the merge has completed then re-insert the formfields for all records in a single pass - all you need is a placeholder for that, as the article in the link indicates.
Thanks again, I'm going to spend some time looking into this today. I wasn't sure if there was a way to access a specific section for each record of the merge once it was completed (I haven't done much VBA in Word before), and figured that appending an existing range to the end of the document after each record merge would be an easy way to accomplish this task.
Quote:
Originally Posted by macropod View Post
As for values being lost, what you're doing suggests the formfields are not required after the merge - only their results. In that case, you could leave the formfields in the mailmerge main document but use a macro to convert them to their results before executing the merge. Just don't re-save the mailmerge main document after running the macro.
The problem is that the values are cleared when the data source is selected, and my goal is to allow the user to save the document once it has been set up (before the merge is run) so that they have the option to just run or re-run the merge when they need to. This would make their template uneditable once they set up the data source. Also, I'd like to leave the ability to edit these fields in the document after the merge as well.

One other issue that has come up is how I am activating the macro. Once the document is protected for the form fields, the Macros are greyed out (and I didn't want to have the user run them through the menu anyway), so I tried a command button (which, unless I'm doing something wrong, only worked until the document was closed and reopened), and using a MacroButton hyperlink. This seems to work, but requires double-clicking the link to run. Plus, the first click shifts the page view which I find not user-friendly. Is there a better option to give the user a way to run the macro?

Also, I want to reset all of the properties for those fields that are removed. From what I see, that article only creates a new form Field, and sets it's name and text. I need to set it's maximum length, as well as type (number/date/etc.). I don't see anywhere in the language help files that allows me to set these; they are either read only (Format, Type) or non-existant (Maximum Length).

Edit: after some contemplation, I think the way to go might be to use the method in that article, but instead of creating a new form field, locate the form field in the original document, then copy it's range to the merged document.
Reply With Quote
  #3  
Old 10-01-2013, 05:37 PM
macropod's Avatar
macropod macropod is offline TextFields disappear during mail merge Windows 7 32bit TextFields disappear during mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by Cosmo View Post
The problem is that the values are cleared when the data source is selected, and my goal is to allow the user to save the document once it has been set up (before the merge is run) so that they have the option to just run or re-run the merge when they need to.
Since you're using Office 2007, is there a reason for not using Content Controls instead of Formfields? You wouldn't have any of these issues with Content Controls - and the document doesn't even need to be protected for them to work. I know Office 2007 doesn't support checkbox Content Controls, but that can easily be worked around with a dropdown Content Control.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 10-02-2013, 05:37 AM
Cosmo Cosmo is offline TextFields disappear during mail merge Windows Vista TextFields disappear during mail merge Office 2007
Competent Performer
TextFields disappear during mail merge
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Since you're using Office 2007, is there a reason for not using Content Controls instead of Formfields? You wouldn't have any of these issues with Content Controls - and the document doesn't even need to be protected for them to work. I know Office 2007 doesn't support checkbox Content Controls, but that can easily be worked around with a dropdown Content Control.
I'm not familiar with Content controls (I don't use Word often); I'll look into this. Also, I may be using Office 2007, but I don't have control over the final user's version, and would like it to be compatible back to 2003 if possible. Are they compatible with versions that old?

These forms have gone through legal reviews, so they usually can't be redesigned. I have to recreate them as they originally were created, so I can't change the checkboxes.

Thanks again for all of your assistance, I'm going to try to get through setting up the code today so I'll hopefully know if it is working the way I need it to soon, or if any other issues crop up that I wasn't anticipating.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
TextFields disappear during mail merge merge fields disappear in merge doc but prints mdod Word 1 07-19-2013 06:33 PM
Mail Merge Duplication of address on merge RICKY Mail Merge 1 09-26-2012 03:14 PM
TextFields disappear during mail merge Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM
TextFields disappear during mail merge Color in textfields darker/more intense than object paulie_k PowerPoint 3 12-13-2011 09:21 AM
TextFields disappear during mail merge Saving INDV mail merges During the mail merge sedain121 Mail Merge 2 10-04-2011 07:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:37 AM.


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