![]() |
|
#1
|
||||
|
||||
![]()
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 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] |
#2
|
|||
|
|||
![]()
Wow, thank you!
|
#3
|
|||
|
|||
![]()
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 |
![]() |
|
![]() |
||||
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 |
![]() |
acolussi | Word | 9 | 05-16-2013 02:11 AM |
Cross References | egcharles | Office | 0 | 04-19-2009 06:20 AM |