On 20/04/11 16:35, Thomas Blasejewicz wrote:
THIS may be my chance! Please bear with me ...

Good evening
I used to have a "highlighting function" assigned to certain hot keys using MS
Word and Wordperfect. With OpenOffice I could not figure out how make that work
(and so far nobody on the mailing list could tell either although I have asked
several times ...), so I created a macro. In LO I found, that you CAN assign a
function that way, but it does not do yet what I want to do: for example assign
upper or lower case -->
Tools - Customize - Keyboard - Format - *** some attribute ***.
You can do THAT. But ...It switches either to lower or to upper case, but does
not TOGGLE between those two states. You need to assign "lowercase" (or initial
caps for example) to a different shortcut.
(I hate MS Word, but at least it gives you the toggle between these attributes -
which is the convenience word processor users (like me) are looking for.)
Since I have asked similar questions several times already (that was about
highlighting) but NEVER got any answer, I assume that this is either technically
not possible - or nobody knows the answer.
The stupid thing is, LO (or OO which I used before = exact same behavior), comes
with a DEFAULT function of TOGGLING between superscript (or subscript) and
normal script.: Ctrl+Shift+P.
If this function **IS** available for superscript (for example), I cannot
understand why this is NOT available for attributes like bold, highlight, upper
case etc. Is there any essential difference between one font attribute and
another???

With all due respect, but I think this is a really stupid/annoying behavior.

If there IS a solotion to this problem I would really like to know!
Thank you.
Thomas


(2011/04/20 22:49), RA Brown wrote:
 Vic Dura wrote:
 Is this list server still active?

 It is still running, just few questions coming in.

 Andy

perhaps this (from http://www.darwinwars.com/oo_main.html) is something like you're after?

sub CaseChanger
' silly macro by Andrew Brown
' This works like the corresponding command in MS Word, though only on single words:
' if you assign it to a key, successive key presses
' will cycle through upper case, lower case and title case.
Dim oDocument, oDesktop as Object
Dim oText as Object
Dim oVCursor, oCursor As Object
Dim sWombat as string
' the two following lines get the active document
oDesktop = createUnoService("com.sun.star.frame.Desktop")
oDocument= oDesktop.getCurrentComponent()
oText = oDocument.Text
oVCursor = oDocument.currentcontroller.getViewCursor()
oCursor = oText.createTextCursorByRange(oVCursor.getstart())
oCursor.gotoStartOfWord(false)
oCursor.gotoEndOfWord(true)
' the next routine checks if the word has several cases in it,
' and irons them out. Otherwise everything works erratically lower down
if oCursor.GetPropertyState("CharCaseMap")>0 then
oCursor.SetPropertyToDefault("CharCaseMap")
oCursor.CharCaseMap=2
end if
sWombat=oCursor.getPropertyValue("CharCaseMap")
'msgbox "CharCaseMap is now " + sWombat
if sWombat="1" then ' we have lowercase text
oCursor.CharCaseMap = com.sun.star.style.CaseMap.TITLE
elseif sWombat="2" then ' already title case
oCursor.CharCaseMap=com.sun.star.style.CaseMap.UPPERCASE
elseif sWombat="3" then ' we have uppercase
oCursor.CharCaseMap = com.sun.star.style.CaseMap.LOWERCASE
else
oCursor.SetPropertyToDefault("CharCaseMap")
end if
end sub



Seems to work. Sort-of :-)


--
Mike Scott
Harlow, Essex, England
--
-----------------------------------------------------------------
To unsubscribe send email to users-unsubscr...@openoffice.org
For additional commands send email to sy...@openoffice.org
with Subject: help

Reply via email to