Am 16.04.2012 22:36, Séamas Ó Brógáin wrote:
Regina wrote:

They are usually written via AutoCorrect. The simple hyphen is replaced
with the en-dash or em-dash when the following word is finished . . .

That is _not_ a good idea. The hyphen, en rule and em rule (dash) are
distinct characters with distinct uses in conventional typography and
typesetting. Their correct use cannot be predicted by context, nor are
they interchangeable.


There is AutoCorrect, there is AutoText (F3 and Ctrl+F3) and there is a most simple macro:
REM  *****  BASIC  *****
sub Insert_Em_Dash()
REM the quoted string is one em-dash
insertChar "—"

REM same with decimal:
' insertChar Chr(8212)

REM same with a hex number:
'insertChar Chr(cInt("&H2014"))
end sub

sub Insert_En_Dash()
insertChar Chr(cInt("&H2013"))
end sub

sub Insert_Figure_Dash()
insertChar Chr(cInt("&H2012"))
end sub

sub insertChar(s$)
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = s
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub


--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to