Could someone help by creating two macros to accomplish the steps below?
I plan to associate the macros with buttons and add the buttons to the Quick Access Toolbar (QAT). This will make it easier to insert the two types of cross-references.
I have tried recording the macros, but the steps aren’t recorded unless I complete the entire process, that is, select the item to be inserted as the cross-reference. I want the macro to stop before actually inserting the cross-reference, which will make
it possible for me to select the reference to be inserted.
I also tried recording the macro to the point of actually inserting a cross-reference and then removing the unwanted steps. The removal of the steps created an error in the macro that I can’t resolve.
If I use the macros, I can limit the number of selections I have to make when I insert cross references.
Steps for Figure Cross-Reference
Insert tab. Click Cross-reference.
Reference type (select) Figure.
Insert reference to (select) Only label and number
Insert as hyperlink selected (yes)
Stop
At this point, I will manually select the appropriate figure number (heading for the next version of the macro) and click Insert.
Steps for Heading Cross-Reference
Insert Cross-reference.
Reference type (select) Heading
Insert reference to (select) Heading text
Insert as hyperlink selected (yes)
Stop
The macros should run regardless of the values selected as the reference type and the insert reference. That is, because the selected values are persisted each time the Cross-Reference dialog box is closed, running the macro should not fail when the persisted
state is the same as the stated defined by the macro.