Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2024, 08:41 PM
gsjmia gsjmia is offline Cross References lost after mail merge Windows 11 Cross References lost after mail merge Office 2021
Novice
Cross References lost after mail merge
 
Join Date: Feb 2024
Posts: 3
gsjmia is on a distinguished road
Default Cross References lost after mail merge

I am a lawyer and have recently been investing the time to use mail merge.



But, on a long agreement, I thought it would be a good idea to set up my template for mail merge, then put all the specifics in excel (e.g, the name of the parties, officers names, addresses, etc.) merge it, and then use the results as my starting draft before customizing for the deal at hand.

But the 65 page template has cross references, because I frequently will add or remove paragraphs, depending on what is needed.

The merged resulting doc, no longer has dynamic cross references.

I can understand why, if I was using the merge for a mailing letter, or a number of docs, all the cross references would create a nightmare.

But I am just merging one doc-is there anyway to preserve the auto cross references?
Reply With Quote
  #2  
Old 02-18-2024, 02:24 PM
macropod's Avatar
macropod macropod is offline Cross References lost after mail merge Windows 10 Cross References lost after mail merge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
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

About the only way would be to have your mailmerge main document update the fields, then save it as a normal document and convert all the mergefields to their results. A fairly simple macro could be used for the last part. A slightly more involved macro could be used for the lot.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-18-2024, 07:44 PM
gsjmia gsjmia is offline Cross References lost after mail merge Windows 11 Cross References lost after mail merge Office 2021
Novice
Cross References lost after mail merge
 
Join Date: Feb 2024
Posts: 3
gsjmia is on a distinguished road
Default

Thank you macropod, I didn' know that the mailmerge fields could be converted, how would you do that?
Not asking for you to create macro, but what are the features/steps?
Reply With Quote
  #4  
Old 02-19-2024, 05:30 AM
macropod's Avatar
macropod macropod is offline Cross References lost after mail merge Windows 10 Cross References lost after mail merge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
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

For example (easier to code than explain):

Code:
Sub Demo()
' Sourced from: https://www.msofficeforums.com/mail-merge/52094-cross-references-lost-after-mail-merge.html
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  .Fields.Update
  .MailMerge.MainDocumentType = wdNotAMergeDocument
  For i = .Fields.Count To 1 Step -1
    With .Fields(i)
      Select Case .Type
        Case wdFieldMergeField, wdFieldMergeBarcode, wdFieldMergeRec, wdFieldMergeSeq: .Unlink
      End Select
    End With
  Next i
End With
Application.ScreenUpdating = True
With Application.Dialogs(wdDialogFileSaveAs)
  .Format = wdFormatXMLDocument
  .Show
End With
End Sub
Note: You'll need to save the mailmerge main document in the .docm format after adding the macro.

For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-19-2024, 10:19 AM
gsjmia gsjmia is offline Cross References lost after mail merge Windows 11 Cross References lost after mail merge Office 2021
Novice
Cross References lost after mail merge
 
Join Date: Feb 2024
Posts: 3
gsjmia is on a distinguished road
Default

Wow, thank you!
Reply With Quote
  #6  
Old 06-20-2024, 06:18 PM
Coitw Coitw is offline Cross References lost after mail merge Windows 10 Cross References lost after mail merge Office 2021
Novice
 
Join Date: Jun 2024
Posts: 1
Coitw is on a distinguished road
Default

macropod thank you very much for providing that macro. I have a similar use to OP for this and it seems to be almost exactly what I was after.

An issue that I have encountered that I wonder if you can help with is that my document uses If...Then...Else... merge fields. While the normal merge fields appear to be correctly converted to static text, the if fields do not get converted... Are you able to point me in the right direction to fix this?

Edit: I have been able to resolve my own issue by adding the 'wdFieldIf' type to the line where fields are unlinked (so that it now reads: 'Case wdFieldMergeField, wdFieldMergeBarcode, wdFieldIf, wdFieldMergeRec, wdFieldMergeSeq: .Unlink')

In the hope that this might assist others with this issue in the future, I found the relevant enumeration here: WdFieldType enumeration (Word) which should allow you to find any specific/niche field types to insert into that line.

Last edited by Coitw; 06-20-2024 at 06:30 PM. Reason: Resolved own issue
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
cross-references gurpreetsandhu Word 1 06-06-2019 04:13 PM
About Cross-references mohsen.amiri Word 1 01-19-2017 10:35 AM
Convert manual cross references in footnotes to other footnotes to automatic cross references ghumdinger Word VBA 7 11-20-2014 11:47 PM
Cross References lost after mail merge Cross-References acolussi Word 9 05-16-2013 02:11 AM
Cross References egcharles Office 0 04-19-2009 06:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:50 PM.


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