ExecuteSearch versus createSearchDescriptor

Creating a macro - Writing a Script - Using the API

ExecuteSearch versus createSearchDescriptor

Postby NorthTexasOldMan » Sun Jul 20, 2014 7:13 am

If I record a macro in Writer I can limit the search to selected text.

args1(0).Name = "SearchItem.SearchFlags"
args1(0).Value = 6144
dispatcher.executeDispatch(doc, ".uno:ExecuteSearch", "", 0, args1())

However createsearchdescriptor will not recognize searchflags=6144

I'm confused because executeSearch will find
args1(0).Name = "SearchItem.SearchString"
args1(0).Value = "Find this"
createsearchdescriptor will also find SearchString="Find this"

Can createsearchdescriptor search only selected text?
Open Office 3.4.1 on Windows 7
Posts: 18
Joined: Thu Jan 16, 2014 2:22 am

Re: ExecuteSearch versus createSearchDescriptor

Postby Villeroy » Sun Jul 20, 2014 1:11 pm

Don't waste your time with all this bullshit. It's not worth it. menu:Edit>Find&Replace (Ctrl+F) is the way to go when using this office suite.
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
User avatar
Posts: 29497
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 5 guests