Forum Discussion
b0nkrates
Dec 13, 2022Copper Contributor
abbreviations
Hello community, I m currently facing an issue with my abbreviations in my master thesis. All my abbreviations are followed by the curly brackets containing the indices. I already tried all combina...
Dec 13, 2022
Even though by default, XE fields are formatted as hidden text, it is not possible to turn off their display and if you go to the Backstage Print view, you will see that the XE fields are not visible and will not print.
While I don't really recommend it, if you really want to hide them, you could use a macro containing the following code that will format the font used for them with the colour white and then uses an Advance field to move the following text to the left so that the space occupied by the XE field is "overwritten" by the following text.
(You might ask why I developed the code? It was developed in response to a user betting me that I could not hide XE fields. The user in question welshed on the bet)
' Macro created 21 March 1999 by Doug Robbins to hide XE fields
'
Dim axe As Field
For Each axe In ActiveDocument.Fields
axe.Select
If Mid(Selection.Text, 3, 2) = "XE" Then
RangeStart = Selection.Information(wdHorizontalPositionRelativeToPage)
Selection.Collapse Direction:=wdCollapseEnd
RangeEnd = Selection.Information(wdHorizontalPositionRelativeToPage)
RangeLength = RangeEnd - RangeStart
axe.Select
Selection.Font.ColorIndex = wdWhite
Selection.Collapse Direction:=wdCollapseEnd
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"ADVANCE \l " & RangeLength & """, PreserveFormatting:=False"
End If
Next axe