[Solved] Select a Writer table and change its settings

Creating a macro - Writing a Script - Using the API

[Solved] Select a Writer table and change its settings

Postby TmTm » Sun Jan 13, 2019 12:51 am

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
TmTm
 
Posts: 4
Joined: Tue Nov 01, 2011 12:06 am

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

Postby FJCC » Sun Jan 13, 2019 1:45 am

This will set that property of whatever table the cursor is in.
Code: Select all   Expand viewCollapse view
oCurrentController = ThisComponent.getCurrentController()
oViewCursor = oCurrentController.getViewCursor()
oTextTable = oViewCursor.TextTable
 
oTextTable.Split = False
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7657
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

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

Postby TmTm » Sun Jan 13, 2019 2:08 am

Thank you very much!
OpenOffice.org 3.3
Windows 7
TmTm
 
Posts: 4
Joined: Tue Nov 01, 2011 12:06 am

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

Postby F3K Total » Sun Jan 13, 2019 1:34 pm

Hi,
this macro does all tables in one step:
Code: Select all   Expand viewCollapse view
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
F3K Total
Volunteer
 
Posts: 964
Joined: Fri Dec 16, 2011 8:20 pm

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

Postby TmTm » Sun Jan 13, 2019 6:03 pm

Thank you much. Valuable. Appreciate it.
OpenOffice.org 3.3
Windows 7
TmTm
 
Posts: 4
Joined: Tue Nov 01, 2011 12:06 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 2 guests