VBA - Inserting Fields
StyleRef
Inserting nested fields using VBA
It is usually best to use ranges in VBA code, and avoid using selections. However, VBA does not allow you to create nested fields "on the fly" using ranges.
The best workaround is to store your frequently used nested fields as AutoText entries in an Add-in. The you can insert the Autotext entry using ranges:
Using selections in Headers or Footers is a complete no-no.
So if you need to create a nested Headers or Footer field "on the fly", create the field in the main document, and cut and paste it into the Headers or Footer:
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext