Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Word 2010: Shortcut for short VBA script

Nov 12, 2014 12:28PM PST

Hi all. I'd like to automate a VBA script I have in Word 2010. I've been given a short VBA script to lock the numbering in my document (so other users cannot change the numbering in my lists). The method I use to carry out this code is:

--Press Alt+F11 to activate the Visual Basic Editor.
--Press Ctrl+G to activate the Immediate window.
--Type or copy/paste the following line: ActiveDocument.ConvertNumbersToText

Is there a way to automate this process to a single keyboard shortcut? Possibly via a macro? I tried to record a macro to carry out the above tasks, but was met with unexpected results. I clicked 'record macro,' then carried out the above steps as usual, then clicked 'stop recording.' But the numbering did not end up locked.
Or perhaps I can save this VBA code so all Word documents can access it, then assign it a keyboard shortcut?
Thanks in advance. Bear with me as I've never used visual basic before.

Discussion is locked