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
I then did a search on this control and found an MSDN article showing that it takes a boolean argument.
http://tinyurl.com/bxprt6b
So, I added this code to my macro, which seems to work.
Code:
ActiveWindow.View.ShowFieldCodes = False
My questions is, "Why does the macro recorder return the toggle option rather than the explicit settiong?". It did the same thing for TrackRevisions.