I need to insert a static time into a Word 2010 document as I'm taking notes. Then I want to make that timestamp hidden text so that it doesn't appear in my official version.
I managed to cobble together a macro and assign it to Ctrl-1, but I noticed an odd side effect. When I run this macro, suddenly Word stops finding spelling as I type. I checked all my settings, and they're okay.
What I discovered was that this macro is setting the Language proofing to do not check spelling or grammar. If I select everything in the document and clear that setting, everything's okay.
Using the technique of commenting out lines in my macro until I found the one that caused the problem, I found that it's this statement:
Selection.Fields.Unlink
Here's my macro. Can anyone help? I'm new to macros, but I'm familiar with the concept from previous work with VBScript.
Sub InsertStaticTime()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldTime
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Fields.Unlink
Selection.Font.Hidden = True
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Font.Hidden = False
End Sub