Java, C++, C#, Delphi, ??? - Using the UNO bridges
by liste » Sun Nov 16, 2014 11:35 am
I am using Delphi Vcl and I want to use Search&Replace command in openoffice or libreoffice calc program. there is one example in here (
http://stackoverflow.com/questions/7806 ... e-document ) but it is work in only odt file. I need for ods (calc) Find&Replace code for pascal or delphi
thanks for helps
OpenOffice 4.1 on Windows 7
-
liste
-
- Posts: 2
- Joined: Thu Nov 13, 2014 12:47 pm
by karolus » Sun Nov 16, 2014 4:49 pm
Hallo
In Case of
Calc-files the Method .
.createReplaceDescriptor is available on Ranges like single sheets.
- Code: Select all Expand viewCollapse view
...
sheet : = StarDocument.Sheets.getByIndex(0);
FileReplace := sheet.CreateReplaceDescriptor;
....
sheet.ReplaceAll(FileReplace);
Karolus
AOO4, Libreoffice - 5.1 … 5.3.2.2 on Linux Mint17
-

karolus
- Volunteer
-
- Posts: 852
- Joined: Sat Jul 02, 2011 9:47 am
by Charlie Young » Sun Nov 16, 2014 5:34 pm
I would add that there is one poorly documented property of the SearchDescriptor which is specific to Calc:
SearchType (not included in API-reference ) integer - Determines if the search should be done in cell formulas (0) values (1) or notes (2). [Calc only]
Apache OpenOffice 4.1.1
Windows XP
-

Charlie Young
- Volunteer
-
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
by liste » Mon Nov 17, 2014 5:57 pm
hi Karolus
Thanks for answer. I try to test that code but there is no Create Replace Descriptor event on sheet object can you send me small sample?
karolus wrote:Hallo
In Case of
Calc-files the Method .
.createReplaceDescriptor is available on Ranges like single sheets.
- Code: Select all Expand viewCollapse view
...
sheet : = StarDocument.Sheets.getByIndex(0);
FileReplace := sheet.CreateReplaceDescriptor;
....
sheet.ReplaceAll(FileReplace);
Karolus
OpenOffice 4.1 on Windows 7
-
liste
-
- Posts: 2
- Joined: Thu Nov 13, 2014 12:47 pm
by karolus » Mon Nov 17, 2014 6:07 pm
I'm only tell you what I've inspected with the Help of
MRIUse the tool by yourself!
AOO4, Libreoffice - 5.1 … 5.3.2.2 on Linux Mint17
-

karolus
- Volunteer
-
- Posts: 852
- Joined: Sat Jul 02, 2011 9:47 am
by Charlie Young » Mon Nov 17, 2014 9:12 pm
liste wrote:hi Karolus
Thanks for answer. I try to test that code but there is no Create Replace Descriptor event on sheet object can you send me small sample?
karolus wrote:Hallo
In Case of
Calc-files the Method .
.createReplaceDescriptor is available on Ranges like single sheets.
- Code: Select all Expand viewCollapse view
...
sheet : = StarDocument.Sheets.getByIndex(0);
FileReplace := sheet.CreateReplaceDescriptor;
....
sheet.ReplaceAll(FileReplace);
Karolus
These things are case sensitive, try createReplaceDescriptor.
Apache OpenOffice 4.1.1
Windows XP
-

Charlie Young
- Volunteer
-
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Return to External Programs
Who is online
Users browsing this forum: No registered users and 1 guest