I have a word document with mailmerge fields and formula (mostly if statements).
The cells they are embedded in are so small that I cannot view either the field or the formula without copying and pasting the formula into Notepad.
Is there a way via VBA to:
Make a copy of your mailmerge main document, then run the following macro against the copy:
Sub Demo()
Application.ScreenUpdating = False
ActiveWindow.View.ShowFieldCodes = False
With ActiveDocument.Range
Do While .Tables.Count > 0
.Tables(1).ConvertToText vbTab
Loop
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Text = ""
.Format = False
.Wrap = wdFindContinue
.MatchWildcards = True
.Text = "[^32-^255]"
.Execute Replace:=wdReplaceAll
End With
.Style = wdStyleNormal
.Font.Reset
.Fields.Update
End With
ActiveWindow.View.ShowFieldCodes = True
Application.ScreenUpdating = True
End Sub
You should end up with a document containing just the fields (displayed), some images, tabs & paragraph/line breaks.