VBA - Inserting Nested Fields
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:
However, if you really need to create the field dynamically you will have to use selections instead of ranges.
You cannot use Selections in the Headers and Footers.
If you need to create a nested Headers or Footer field dynamically then 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