Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Tim Deaton <tim@timdeaton.org> wrote:
On 7/31/2014 7:06 AM, Jon Harringdon wrote:
Someone with more knowledge about LO extensions than I have (nil) could
probably do that, but then again those two macros are dead simple: I
basically just macro-recorded the two actions, cleaned up the resulting
macros a bit and put them on shortcuts. No magic at all.

Could you post the macros' code here?

I don't remember seeing that behavior for toggling the highlight on/off 
in version 3.x, but noticed it in either 4.0 or 4.1 (maybe both) and 
liked it.  But by 4.2 it was gone again.  I did some work with 
macros/vba in Excel (v4 thru 1997), but not in MS Word, and have not 
touched macros in OOo or LO.  Maybe this would be where I could start 
using them.

Sure, see below. However, as I said, it's utterly simple to do this (or
similar small changes) on your own by simply macro-recording (*) the
action of setting a highlight colour as one macro and removing it (ie no
fill) as another.

* Before you can record macros you probably have to enable "Enable macro
recording (limited)" in the LibreOffice>Advanced options. (I am using
4.2.5.)

Additionally, I've put the first macro on Ctrl-H and the second on
Shift-Ctrl-H (ignoring spurious (and annoying) error messages about Java
RE not being installed...).

HTH Jon

sub HiliteOn
dim document, 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 = "BackColor"
args1(0).Value = 16777113
dispatcher.executeDispatch(document, ".uno:BackColor", "", 0, args1())
end sub

sub HiliteOff
dim document, dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:BackColor", "", 0, Array())
end sub

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.