Skip to content
English
  • There are no suggestions because the search field is empty.

Setup a Macro to create a Timestamp in a Word document

How to Create a Timestamp Hotkey - (Be Aware - your Office version must be the same bit version as the DLL which is 32bit in order for this to work.) This is how you can create a word Macro so that when the user pushes a hotkey the current timestamp from the currently open dictation is inserted into a document. 1) Create a wsiremote.tlb (library). This will expose an object that contains the current dictation time to the word Macro. Run command prompt as administrator and paste the below line. Use this command: C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /tlb /codebase "C:\Program Files (x86)\Common Files\Winscribe\wsiRemote.dll" 2) Open Word, Create a Macro with this code in the required template (or Normal.dotm if this functionality is required in word generally). in the name field enter name paste the below code into the VB editor. Sub InsertCurrentPlaybackPosition() Dim PP As String Dim vRoundedSeconds As Variant Dim iRoundedSeconds As Integer Dim DisplayTime As String Dim hour As Integer Dim min As Integer Dim sec As Integer Dim shour As String Dim smin As String Dim ssec As String Dim PPObj As wsiRemote.clsWsiTypistDo Set PPObj = New wsiRemote.clsWsiTypistDo PP = PPObj.Position vRoundedSeconds = CLng(PP) vRoundedSeconds = vRoundedSeconds / 1000 iRoundedSeconds = Round(vRoundedSeconds, 2) hour = iRoundedSeconds \ 3600 iRoundedSeconds = iRoundedSeconds Mod 3600 min = iRoundedSeconds \ 60 sec = iRoundedSeconds Mod 60 If Len(CStr(hour)) = 1 Then shour = "0" & CStr(hour) Else shour = CStr(hour) End If If Len(CStr(min)) = 1 Then smin = "0" & CStr(min) Else smin = CStr(min) End If If Len(CStr(sec)) = 1 Then ssec = "0" & CStr(sec) Else ssec = CStr(sec) End If Selection.TypeText Text:=shour & ":" & smin & ":" & ssec End Sub 3) Add a reference in the Word Macro to the .tlb file created in step 1. Tools > References > (scroll to the bottom and select wsiRemote) > Browse > C:\Program Files (x86)\Common Files\Winscribe > Choose the .tlb file. Open > OK. 4) Link the Macro to a Hotkey: File > Options > Customize Ribbon > Keyboard Shortcuts (button) > Customize Scroll down to Macros > Select from the right hand list > Enter a hotkey combination > press Assign > OK.