[Solved] writer macro for extending selection from table to paragraph before and after table
Comment that I can not delete
First time here? Check out the FAQ!
Comment that I can not delete
In question 223599/writer-macro-for-extending-selection-from-table-to-paragraph-before-and-after-table I posed the problem described by the title that @Mike Kaganski had given a solution to Subsequently, after having closed the question, I had found an alternative solution that I propose here since I cannot reopen the closed discussion (it takes more than 200 karma to do this)
sub selectTable1(sTable)
Dim oD, oTab, oCell, oTC1, oVC
oD = ThisComponent
oTab = oD.getTextTables().getByName(sTable)
oVC = oD.getCurrentController().getViewCursor()
oCell = oTab.getCellByPosition(0, 0)
oVC.gotoRange(oCell, false)
oVC.goup(1, false)
oTC1=oVC.text.createTextCursorByRange(oVC)
oTC1.gotoEndOfParagraph(false)
oCell = oTab.getCellByPosition(oTab.columns.count-1, oTab.rows.count-1 )
oVC.gotoRange(oCell, false)
oVC.goDown(1, false)
oTC1.gotoRange(oVC,true)
oD.getCurrentController().select(oTC1)
End Sub
Thanks to @ajlittoz per the explaining the correct procedure to me.
I hope it is correct now.
(yes, I just edited the link to make it nicer)
Asked: 2020-04-28 16:04:39 +0100
Seen: 32 times
Last updated: Jan 28
Writer is not formatting and bordering docx tables the same [closed]
How do you add bullets to an already number-bulleted group of statements? [closed]
Can I use Microsoft Publisher files with LibreOffice? [closed]
Alternating table column numbering, Col1 Numbers, Col2 Letters? [closed]
Are there any plans to improve image handling? [closed]
LibreOffice 3.5 Writer crashes when making PDF [closed]
How can I center the document in a Writer window? [closed]
How to change datasource in form letter / mail merge imported from MS-Word [closed]
@torreone: adding "Solved" in the title is not the right way to mark the question as "solved" because it will still be counted as unanswered by the site engine.
For a much better referencing in the site, answer your own question by cutting "Having found …" up to the end and pasting it in your answer. I used "cutting" instead of "copying", meaning you should edit your question so that it looks like a question (explaining why you ask a new one) which now receives an acceptable answer.
To be really useful your question should include a link to 223599/writer-macro-for-extending-selection-from-table-to-paragraph-before-and-after-table.
A much better solution would be to reopen question #223599 to add your own answer. Your karma is high enough to allow you to do that and delete this one afterwards.
thanks @ajlittoz