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
How to Search and Replace in calc (ods) OpenOffice document
How to Search and Replace in calc (ods) OpenOffice document
OpenOffice 4.1 on Windows 7
Re: How to Search and Replace in calc (ods) OpenOffice docum
Hallo
In Case of Calc-files the Method ..createReplaceDescriptor is available on Ranges like single sheets.
Karolus
In Case of Calc-files the Method ..createReplaceDescriptor is available on Ranges like single sheets.
Code: Select all
...
sheet : = StarDocument.Sheets.getByIndex(0);
FileReplace := sheet.CreateReplaceDescriptor;
....
sheet.ReplaceAll(FileReplace);
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: How to Search and Replace in calc (ods) OpenOffice docum
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]
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
Windows XP
Re: How to Search and Replace in calc (ods) OpenOffice docum
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?
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.
KarolusCode: Select all
... sheet : = StarDocument.Sheets.getByIndex(0); FileReplace := sheet.CreateReplaceDescriptor; .... sheet.ReplaceAll(FileReplace);
OpenOffice 4.1 on Windows 7
Re: How to Search and Replace in calc (ods) OpenOffice docum
I'm only tell you what I've inspected with the Help ofMRI
Use the tool by yourself!
Use the tool by yourself!
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: How to Search and Replace in calc (ods) OpenOffice docum
These things are case sensitive, try createReplaceDescriptor.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.
KarolusCode: Select all
... sheet : = StarDocument.Sheets.getByIndex(0); FileReplace := sheet.CreateReplaceDescriptor; .... sheet.ReplaceAll(FileReplace);
Apache OpenOffice 4.1.1
Windows XP
Windows XP