Created
February 25, 2018 13:44
-
-
Save royashbrook/96b430a32b30f6082a568df813b1f800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' need tools/references and add a reference to word | |
| Sub InsertDateTime() | |
| ' strings to print | |
| Dim t, n, v, delim As String | |
| t = Format(Now(), "YYYY-MM-DD hh:mm:ss") & " EST" | |
| n = "Roy Ashbrook" | |
| delim = " | " | |
| Dim d As Word.Document | |
| Dim s As Word.Selection | |
| Set d = Application.ActiveInspector.WordEditor | |
| Set s = d.Windows(1).Selection | |
| s.GoTo (0) | |
| s.TypeText vbCrLf | |
| s.GoTo (0) | |
| s.Font.ColorIndex = wdBlue | |
| s.Font.Bold = True | |
| s.TypeText t | |
| s.Font.ColorIndex = wdAuto | |
| s.Font.Bold = False | |
| s.TypeText delim | |
| s.Font.ColorIndex = wdRed | |
| s.Font.Bold = True | |
| s.TypeText n | |
| s.Font.ColorIndex = wdAuto | |
| s.Font.Bold = False | |
| s.TypeText delim | |
| Set s = Nothing | |
| Set d = Nothing | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment