79661871

Date: 2025-06-11 11:04:11
Score: 0.5
Natty:
Report link

I stumbled upon the answer right after posting. 😅 Text cursor is called "Selection" in VBA.

Here is the Procedure Sub, and a Sub to bind it to Ctrl+Shift+Tab. Add this as VBA to your Normal.dotm to use in all your documents. 😊

Public Sub InsertTabStop()
  Selection.Paragraphs.TabStops.Add (Selection.Information(wdHorizontalPositionRelativeToTextBoundary))
End Sub
 
Sub AddKeyBind()
  Dim KeyCode As Long
  'Change the keys listed in "BuildKeyCode" to change the shortcut.
  KeyCode = BuildKeyCode(wdKeyControl, wdKeyShift, wdKeyTab)
 
  CustomizationContext = NormalTemplate
  If FindKey(KeyCode).Command = "" Then
    KeyBindings.Add wdKeyCategoryMacro, "InsertTabStop", KeyCode
  Else
    MsgBox "Error: Key combination is already in use!" & vbNewLine & vbNewLine & "Key binding not set.", vbOKOnly + vbCritical, "Key binding failed"
  End If
End Sub
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: AzureSkye