Skip to content

Instantly share code, notes, and snippets.

@Vinzz
Created January 8, 2018 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vinzz/6bd1799e9d64e66914cc614499a47170 to your computer and use it in GitHub Desktop.
Save Vinzz/6bd1799e9d64e66914cc614499a47170 to your computer and use it in GitHub Desktop.
Insert cards symbols in black or red within LibreOffice Writer (map these with a toolbar with card symbols as names)
REM ***** BASIC *****
Sub InsertSymbol(text As String, color As long)
Dim oVC As Object
Dim oCursor As Object
Dim savColor as long
oVC = thisComponent.getCurrentController.getViewCursor
oCursor = oVC.getText.createTextCursorByRange(oVC)
savColor = oCursor.charColor
oCursor.charColor = color
oText = oVC.text
oText.insertString(oVC, text, False)
oCursor.charColor = savColor
End Sub
Sub InsertK
InsertSymbol("?", RGB(255,0,0))
End Sub
Sub InsertC
InsertSymbol("?", RGB(255,0,0))
End Sub
Sub InsertT
InsertSymbol("?", RGB(0,0,0))
End Sub
Sub InsertP
InsertSymbol("?", RGB(0,0,0))
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment