Can't get macro to stay in ribbon when reopening document
Hi, First time poster so I hope I am including all relevant information.
I have created a simple macro to allow users to click a button which will note the time and date at which they have done to effectively sign off a document. The code I am using is below and has been working fine when deployed:
Public Sub SignOff_Click()
Selection.TypeText Text:=" "
Selection.InsertDateTime DateTimeFormat:="M/d/yyyy", InsertAsField:=True, _
DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
Selection.TypeText Text:=" "
Selection.InsertDateTime DateTimeFormat:="hh:mm:ss", InsertAsField:=True, _
DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
Selection.TypeText Text:=" "
End Sub
The goal is to have this option display in the ribbon for all users who open the document. I know how to add this to the ribbon using the Options -> Customize Ribbon -> etc. This works fine once it's added in.
The main issue, and I'm not sure if this makes it even possible to do what I want, is that the document must be saved as a .dot format.
I've attached the working document. The EEG shortcuts with Sign Off Now is the button I am looking to add. All associated code with this button seems to be erased each time I reopen.
Alternatively, if anyone has any other ideas to make this work, I would be happy to hear other options.
|