If text is selected I want Control I to make it italics as usual, but if not, I want it to type ī macron (which is what it currently does with this code:
Code: Select all
sub imacron
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Symbols"
args1(0).Value = "ī"
dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())
end sub