A family of Microsoft word processing software products for creating web, email, and print documents.
What do you mean "... and named it DateDoneRight"?
It is already named DateLongStamp.
1. Close down Word, then open Word
- Open the VBE (Alt+F11)
3. Locate and select the project in the Project Explorer (Project pane). The project you select will be called "Project (Document 1).
4. Expand that tree (click the little + sign on the left)
5. Expand the Microsoft Word Object tree (click the little + sign on the left)
- Dbl-Click "ThisDocument"
- In the big empty code window on the right of the VBE, paste in:
Sub DateLongStamp()
'Inserts current date
Selection.InsertDateTime DateTimeFormat:="dddd, MMMM d, yyyy", InsertAsField:=False
End Sub
8. Press the F8 key (three times to step through the code) or press F5 to run the code, or press "Run>Run Sub/Userform" on the VB Editor menu.
9. Close the VBE and look at your document.
What is the result?
Mr Maxey,
I got the idea of DateDoneRight from your instructions to name it something:
"Select the new module and use the Properties Window "Name" property to give my new module a meaningful name (e.g., I often name my modules modMain)."
So I named it something.
To your latest instructions I did each step as instructed and got:
“Compile error invalid outside procedure”, again.
I notice that another large white box opened that reads
"Normal – AutoCorrect Utility(Code) and inside that is the following:"
Option Explicit
frmAutoCorrect.Show
End Sub