![]() |
|
#1
|
||||
|
||||
![]()
I wanted to write a macro to turn off the ShowFieldCodes setting, which somehow got changed. I used the macro recorder to capture the code for turning it on and off. One macro below turned it on and one turned it off. Oddly, they both have the exact same code. Is this a toggle?
Code:
Sub Macro1() ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes End Sub Sub Macro2() ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes End Sub http://tinyurl.com/bxprt6b So, I added this code to my macro, which seems to work. Code:
ActiveWindow.View.ShowFieldCodes = False |
#2
|
||||
|
||||
![]()
I guess MS programmed the Macro Recorder than way so it didn't have to test the property state and you could use the same code for both actions.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ralphpickering | Word VBA | 5 | 10-24-2012 10:15 AM |
![]() |
Ulodesk | Word VBA | 6 | 07-02-2012 09:23 AM |
How do I assign a macro to a button when the macro is in my personal workbook? | foolios | Excel Programming | 2 | 07-27-2011 02:41 PM |