On 08/21/2010 05:08 AM, Thomas Blasejewicz wrote:
> Andrew Douglas Pitonyak さんは書きました:
>>  What do you mean by "Highlight"?
>>
>> Can you write a single macro to do this? My guess is that it can be done
>> if you desire to do so. the trick, however, is that your macro must be
>> able to determine the current state so that it can be toggled.
>>
>> You say that you have a macro that turns it on, and one that turns it off.
>>
>> Can you post the macros for this and let me have a look?
>>
>> On 08/20/2010 10:05 PM, Thomas Blasejewicz wrote:
> By "highlight" I mean applying a colored background to the selected text
> (in the form of a fluorescent marker).
> Naturally, that makes the text stand out.
>
> Yes, I DO have 2 macros (it took me some struggle to set them up).
> One applies the background color to the text (highlight it) and the
> other removes it, if I select exactly the highlighted text.
> I would love to send you the macro content, but I am afraid I do not
> know how find, copy and paste the content.
>
> If you could me a hint as to how to achieve that I will gladly provide
> you the requested information
I have good news and bad news :-)

There is a background attribute which contains the color for the
background. You can grab the cursor and check to see if the background
is set to your special background color (or if it is set to anything at
all). Then, you can make your decision of what to do based on that
(clear it or set it). There may be a few difficulties based on the
complexity of your selection and things such as cursor position. For
example, what happens if you select a range of text and only part of it
has the background set and part does not? Also, if the cursor is
positioned at the end of the text with the background, you may
experience a different result than if it is at the front. I could ramble
on, but, no reason at this point.

As to how to find the macro, well, this depends on where you stored it
in the first place. The macro may be stored in a single document, in
which case it should only be available in a single document. It is most
likely stored in the OOo Standard library.

Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the
OOo Macros dialog.

In the left side of the screen, scroll to the top of the list labeled
"Macro From". Expand "My Macros". There should be a Library named
"Standard". I would look there first. Highlight a module (probably named
"Module 1" and click Edit.

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to