Re: Request mwike account or something to that effect
On 12/12/2012 20:14, Ed Bradford wrote: I would like to ask a question about how to write a macro that can dynamically discover a table to sort. Having to define each range and each macro to sort each range doesn't work for me. I might be missing something, but I simply wanted to ask my question: How can a Macro dynamically discover the range of data to apply its logic to? Ed Bradford Pflugerville,TX egbe...@gmail.com Hi, Ed, You get a reward for spelling out your problem: a direct answer, instead of an unfortunate runaround. Your question belongs on the User Forum[1], but you will probably find the answers already there, with useful code examples and in much greater detail than the brief explanation below. If you still need to ask something, sign up for a forum account (that's DIY). Writer keeps its tables in a collection, available from the document object. You can iterate through the collection, looking for tables that meet your criteria for needs sorting. Each table has a collection of rows. That collection has a useful property, .getCount(), which returns the number of rows. Happy sorting! HTH, /tj/ [1] http://forum.openoffice.org/en/forum/ (If you distrust emailed links, follow the link in the navigation box, on the left of every page in the wiki.)
Re: Request mwike account or something to that effect
On 12/12/2012 08:14 PM, Ed Bradford wrote: I would like to ask a question about how to write a macro that can dynamically discover a table to sort. Having to define each range and each macro to sort each range doesn't work for me. I might be missing something, but I simply wanted to ask my question: How can a Macro dynamically discover the range of data to apply its logic to? Ed Bradford Pflugerville,TX egbe...@gmail.com Greetings from Ohio Ed You can find some examples of dealing with text tables in OOME on my web site. You can obtain the table list directly, and iterate through the tables. You can iterate through the text content and recognize tables when you find them (but this requires a bit more work if you have tables inside of tables, text frames containing tables, or text sections containing tables). If the cursor is inside of the text table, then you can find the text table that contains the cursor directly. I would need to do a bit of reading to remind myself if you can get this directly from the view cursor or if you need to create a text cursor first. That said, I need to run, my ride is almost here. -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt Info: http://www.pitonyak.org/oo.php