View Single Post
 
Old 02-09-2015, 05:35 PM
Guessed's Avatar
Guessed Guessed is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The macro is putting 'typed text' into the document so the text won't change automatically. You were putting in fields which showed the time when the field was last updated. This was fine until the fields were updated. It also would have remained fine if the fields were either locked or broken by selecting them and pressing the relevant keyboard shortcuts. However at some stage the fields got updated so they all showed the same time. There are Word options that can be turned off/on that automatically update fields when opening or printing a document - I suspect this is what happened to your document if you didn't select the fields and update them yourself.

It sounds like your workflow is more complicated than it needs to be. In order to minimise keystrokes you should associate the macro with a keyboard command. For instance, I would use the following modification to Graham's code and associate it with Ctrl-Alt-Enter so I didn't need to type the paragraph mark as well.
Code:
Sub InsertReturnTime()
  Dim orng As Range
  Set orng = Selection.Range
  orng.Text = vbCr & Format(Time, "HH:MM:SS | ")
  orng.Collapse 0
  orng.Select
lbl_Exit:
  Exit Sub
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote