[Solved] Select a Writer table and change its settings

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
TmTm
Posts: 8
Joined: Tue Nov 01, 2011 12:06 am

[Solved] Select a Writer table and change its settings

Post by TmTm »

I work with documents with many hundreds of tables. I would like a simple shortcut (a macro assigned to a keystroke) to deselect "allow table to split..."
Recording the keystrokes does not produce results.
Thank you for helping this amateur.
Last edited by TmTm on Sun Jan 13, 2019 2:15 am, edited 1 time in total.
OpenOffice.org 3.3
Windows 7
FJCC
Moderator
Posts: 9277
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: macro: select a table and choose not to allow table to s

Post by FJCC »

This will set that property of whatever table the cursor is in.

Code: Select all

oCurrentController = ThisComponent.getCurrentController()
oViewCursor = oCurrentController.getViewCursor()
oTextTable = oViewCursor.TextTable
  
oTextTable.Split = False
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
TmTm
Posts: 8
Joined: Tue Nov 01, 2011 12:06 am

Re: macro: select a table and choose not to allow table to s

Post by TmTm »

Thank you very much!
OpenOffice.org 3.3
Windows 7
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: [Solved] Select a Writer table and change its settings

Post by F3K Total »

Hi,
this macro does all tables in one step:

Code: Select all

Sub disallow_Texttables_split
   oTexttables = thisComponent.Texttables
   for i = 0 to oTexttables.count - 1
       oTexttable = oTexttables(i)
       oTexttable.split = false
   next i
   print "For " & oTexttables.count & " tables splitting disallowed"
End Sub
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
TmTm
Posts: 8
Joined: Tue Nov 01, 2011 12:06 am

Re: [Solved] Select a Writer table and change its settings

Post by TmTm »

Thank you much. Valuable. Appreciate it.
OpenOffice.org 3.3
Windows 7
Post Reply