[Solved] Turn Tools-Autoinput Off By Macro If it is On

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Dheeraj
Posts: 11
Joined: Sun Jun 14, 2020 12:46 pm

[Solved] Turn Tools-Autoinput Off By Macro If it is On

Post by Dheeraj »

I want to Turn Autoinput Off (Tools-Autoinput) by Macro. I have recorded a macro which toggles AutoInput. This macro does not serve my goal as it Turns On AutoInput if it is already Off. My goal is - if Autoinput is off, do nothing else turn Autoinput Off. Any help is greatly appreciated.

Recorded Macro is here mentioned below:

Code: Select all

Sub Autoinput
Dim document as object
Dim dispatcher as object

document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dispatcher.executeDispatch(document,".uno:AutoComplete","",0,Array())

End Sub
Last edited by robleyd on Wed Jul 29, 2020 1:54 pm, edited 2 times in total.
Reason: Tagged [Solved]
Openoffice 4.1
Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Turn Tools-Autoinput Off By Macro If it is On

Post by Villeroy »

Code: Select all

srv = createUnoService('com.sun.star.sheet.GlobalSheetSettings')
srv.DoAutoComplete = False
Last edited by Villeroy on Wed Jul 29, 2020 6:15 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Dheeraj
Posts: 11
Joined: Sun Jun 14, 2020 12:46 pm

Re: Turn Tools-Autoinput Off By Macro If it is On

Post by Dheeraj »

Thanks for Replying Villeroy..

Your Solution is perfect. In my case using Libreoffice, this code is different which is as follows:
srv.DoAutoComplete = False

Problem Solved.
Openoffice 4.1
Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Turn Tools-Autoinput Off By Macro If it is On

Post by Villeroy »

Sorry, that was a typo. I had only the first line in clipboard.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply