2007/4/21, Johnny Andersson <[EMAIL PROTECTED]>:
I know how to do that with simple selections (I am talking about Writer, but it would also be interesting to know the same about Calc) with only one selection, and I thought I figured out how to do it with several selections, but my idea failed completely. No matter what I did, I couldn't reselect more than one single selection. * This is what I want to do: * Select a few pieces of text manually, using the mouse and the Ctrl key. Start the macro. The macro change the selected text, it doesn't matter how and why, but if you like, I can explain it. I actually already did that in another thread. *Now the important thing, the reason why I write this in the first place:*When the macro is finished, I want my selections to remain. This is because the user might want to run the macro again for the same selected text (and there is a reason for that, I promise). So, as I said, with some help from some of you guys reading this, I found it be not too hard to do this with single selection, but multiple selections made me fail every time. The closest I got was to be able to reselect the last of the multiple selection, making it all a single selection, even if I originally made a multiple selection. Any help would be appreciated. I read the macro manual and I couldn't find the answer there. I found an example where multiple selections were used, but it was never re-selected, or I am just blind. In that case I guess I need help to open my eyes or something. I link or page reference to the macro manual will probably do as an answer to this question. Or just one or a few lines of example code. Many thanks for at least reading this! Johnny Andersson
Wow! Was my question really that tough? He he... do you want me to tell you how to do it if I solve it? One solution is, of course, to do a google search for a macro that does the same thing as mine, and just steal the code (if it can handle multiple selections the way I want), because I think I've read somewhere that someone already created such a thing. Since the reason for me to write my own is for my own "education", I might learn something when stealing. If someone just happens to know the answer to my original question, please don't hesitate to tell me how stupid I am who couldn't figure it out myself. I am sure I can read the answer somewhere, maybe in the macro manual. It's just so hard to find it since my English is totally useless, so I really don't know what to search for. Sorry for being such a jerk. Johnny Andersson
