Search found 2758 matches

by JeJe
Thu Mar 28, 2024 6:03 pm
Forum: Macros and UNO API
Topic: Scale picture in merged Calc cells
Replies: 2
Views: 48

Re: Scale picture in merged Calc cells

Select the cells, then:

Code: Select all

thiscomponent.currentselection.size
by JeJe
Wed Mar 27, 2024 11:29 pm
Forum: Writer
Topic: Limited space in each document one create?
Replies: 13
Views: 855

Re: Limited space in each document one create?

If you have some long text with line feed characters you could try pasting it into Notepad as an intermediary and then from there into Writer. That may convert the line feeds to paragraph marks and let you do it in one go instead of in chunks.
by JeJe
Tue Mar 26, 2024 3:59 pm
Forum: Macros and UNO API
Topic: Write access to generic statusbar item
Replies: 4
Views: 402

Re: Write access to generic statusbar item

I just use Basic so don't know anything about creating a controller. My code to create a blank clickable status bar item in Basic is here. https://forum.openoffice.org/en/forum/viewtopic.php?t=110487 It is indeed a bit like a nasty hack, but attached is a rudimentary extension for adding a dialog to...
by JeJe
Mon Mar 25, 2024 6:53 pm
Forum: Macros and UNO API
Topic: Sort onto another sheet
Replies: 8
Views: 936

Re: Sort onto another sheet

There's no changed document been uploaded.

Did you try MrProgrammer's suggestion, he's added more links to his post above?
by JeJe
Mon Mar 25, 2024 6:48 pm
Forum: Macros and UNO API
Topic: Write access to generic statusbar item
Replies: 4
Views: 402

Re: Write access to generic statusbar item

My understanding is: Its not possible to write a statusbar controller in Basic and you'd need to use a different language. You can replace the status bar with a progress bar and some text, but then you lose the status bar features You can create a clickable blank item on the status bar in Basic. And...
by JeJe
Sun Mar 24, 2024 6:09 pm
Forum: Macros and UNO API
Topic: Sort onto another sheet
Replies: 8
Views: 936

Re: Sort onto another sheet

Documents you post should have sensitive information removed. Column c only has green or no color in it. By a separate sheet you seem to mean a sheet in a different document? Perhaps you could make a simple version (with sensitive information removed) of part of the original and the matching result ...
by JeJe
Sun Mar 24, 2024 2:47 pm
Forum: Macros and UNO API
Topic: Sort onto another sheet
Replies: 8
Views: 936

Re: Sort onto another sheet

Have you tried the macro recorder - sounds like it might be able to do what you're asking, or some of it? How did you do them the first time as you talk about rewriting?
by JeJe
Thu Mar 21, 2024 10:38 pm
Forum: Macros and UNO API
Topic: Applying a new style to a page in Writer using Java code
Replies: 6
Views: 540

Re: Applying a new style to a page in Writer using Java code

Thanks Lupp. Yeah, page styles are a paragraph property - not very intuitive. My code assumes that the applied page style's next page style will be the desired one - otherwise you'll also need to set the following page's first paragraph's page style to override the style's next page style setting.
by JeJe
Tue Mar 19, 2024 10:57 am
Forum: Macros and UNO API
Topic: Applying a new style to a page in Writer using Java code
Replies: 6
Views: 540

Re: Applying a new style to a page in Writer using Java code

This creates a new page style and then sets the viewcursor pagestyle to it in Basic with thiscomponent.stylefamilies.getbyname("PageStyles") ps = thiscomponent.CreateInstance("com.sun.star.style.PageStyle") .insertbyname "MyNewStyleName",ps end with thiscomponent.curren...
by JeJe
Tue Mar 19, 2024 3:07 am
Forum: External Programs
Topic: [Solved] LibreOffice Calc Sort via AU3, VBA/VBS
Replies: 5
Views: 673

Re: LibreOffice Calc Sort via AU3, VBA/VBS

Your VB5 code runs for me within LO with an error on the line 'Set tSortField = oServiceManager.Bridge_GetStruct("com.sun.star.table.TableSortField") Looking at MRI the servicemanager doesn't have that property or method runs within LO by changing to Set tSortField = new "com.sun.star...
by JeJe
Tue Mar 19, 2024 2:31 am
Forum: External Programs
Topic: [Solved] LibreOffice Calc Sort via AU3, VBA/VBS
Replies: 5
Views: 673

Re: LibreOffice Calc Sort via AU3, VBA/VBS

You're perhaps not getting other repliers because people here aren't using Autoit and can't explore your problem. As an alternative, if you can use get / setDataArray then presumably Autoit can call its own sort array function? r =thiscomponent.sheets(0).getcellrangebyname("A1:A5") dataarr...
by JeJe
Mon Mar 18, 2024 12:38 am
Forum: External Programs
Topic: [Solved] LibreOffice Calc Sort via AU3, VBA/VBS
Replies: 5
Views: 673

Re: LibreOffice Calc Sort via AU3, VBA/VBS

Have you tried the macro recorder?
by JeJe
Fri Mar 15, 2024 1:07 am
Forum: Code Snippets
Topic: List of Writer Textsections in document order
Replies: 3
Views: 499

Re: List of Writer Textsections in document order

CORRECTED ERROR IN THE SORTING ROUTINES

There may not be an exact match with the navigator list given by the view cursor position in the case of sections in frames.
by JeJe
Wed Mar 13, 2024 5:11 pm
Forum: Code Snippets
Topic: List of Writer Textsections in document order
Replies: 3
Views: 499

Re: List of Writer Textsections in document order

The problem is, if a document is reopened then the textsections will be in document order, but when any textsections are added they get appended to the api list, not added in document order. Or if sections are moved their position is not changed in the API list either. And sections can't be found us...
by JeJe
Wed Mar 13, 2024 3:55 pm
Forum: Code Snippets
Topic: List of Writer Textsections in document order
Replies: 3
Views: 499

Re: List of Writer Textsections in document order

This is to order in both dimensions but that diverges from the list in the navigator in OO which doesn't do so. (again very limited testing)* REM ***** BASIC ***** Option Explicit Sub GetTextSectionInDocOrderIncHorizontal dim cont,vc,ts, i as long,y as long,ub as long,j as long,k as long, x as long,...
by JeJe
Wed Mar 13, 2024 2:47 pm
Forum: Code Snippets
Topic: Getting a sorted overview of all the annotations contained in a Writer document
Replies: 1
Views: 310

Re: Getting a sorted overview of all the annotations contained in a Writer document

Thanks for the idea, I've applied your cunning method to textsections. Its much simpler than enumerating all the paragraphs. https://forum.openoffice.org/en/forum/viewtopic.php?t=111347 As I say there, In the past I have had issues with Writer not always updating the viewcursor position properly whe...
by JeJe
Wed Mar 13, 2024 2:42 pm
Forum: Code Snippets
Topic: List of Writer Textsections in document order
Replies: 3
Views: 499

List of Writer Textsections in document order

Get a list of Writer textsections in the order of where they are in the document * (as they appear in the Navigator, not what is retrieved by the api textsections list which isn't in document order) Uses Lupp's method of getting the position from the viewcursor (as applied to annotation anchors here...
by JeJe
Tue Mar 12, 2024 1:20 pm
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

You seem to keep changing what you're asking - or you're not being clear about what it is. Now you want to edit the contents of the textfield?
by JeJe
Mon Mar 11, 2024 11:15 pm
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

If fhere are versions where the viewcursor returns null for the textfield - then I don't see how you can do anything. If its just getting the anchor that fails, then you could enumerate all the paragraphs and text portions in the document till you find the matching textfield - that would be very slo...
by JeJe
Mon Mar 11, 2024 1:38 pm
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

My code selects the anchor fine for me in LO as well as OO.
by JeJe
Mon Mar 11, 2024 12:43 pm
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

If the viewcursor isn't in a textfield you will get null.
by JeJe
Mon Mar 11, 2024 11:09 am
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

Code: Select all

with thiscomponent.currentcontroller
.select .viewcursor.textfield.anchor
end with
by JeJe
Fri Mar 08, 2024 10:19 pm
Forum: Macros and UNO API
Topic: Get all Annotations/Comments/Notes
Replies: 18
Views: 1678

Re: Get all Annotations/Comments/Notes

The annotations will support the com.sun.star.text.textfield.Annotation service.

https://www.openoffice.org/api/docs/com ... le-ix.html
by JeJe
Tue Mar 05, 2024 9:26 pm
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

Controls have a tabindex so maybe its that order.
by JeJe
Tue Mar 05, 2024 2:55 am
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

I don't understand your first sentence there - there is only one MRI.

If controls have the same name and you use get by name then I presume you get the first control with that name.
by JeJe
Tue Mar 05, 2024 1:03 am
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

MRI is easy, you install it, make sure the library is loaded so it can be used then you type somewhere in your code, MRI whateverobjectname and up pops a window showing all the methods and properties available for your object. I find it indespensible. Edit, this also: https://extensions.openoffice.o...
by JeJe
Mon Mar 04, 2024 11:46 pm
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

In my first post I gave you a one line way - provided you know the index. The reason a loop is needed with the name is because get by name isn't available, just get by index there. You can simplify getting by name to a one line call by putting the loop in separate function as Lupp has done, and that...
by JeJe
Mon Mar 04, 2024 11:40 pm
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

I suggest MRI and learn how to inspect objects and you can examine it yourself. https://forum.openoffice.org/en/forum/viewtopic.php?t=49294 You don't say the line the error occurred. If its this one it could be because the group isn't a control and that's what Form.getByName gets. GroupBox = Form.ge...
by JeJe
Mon Mar 04, 2024 8:48 pm
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

Is your security set to allow Lupp's document macros to run?
by JeJe
Mon Mar 04, 2024 8:23 pm
Forum: Macros and UNO API
Topic: Macro to hide all objects within a group
Replies: 16
Views: 1584

Re: Macro to hide all objects within a group

Lupp's code works for me in LO as well. The simplest version going from the name (testGroupSh in Lupp's document) would be something like this: dim comp,i comp = thiscomponent for i = 0 to comp.drawpage.getcount -1 with comp.drawpage.getbyindex(i) if .name = "testGroupSh" then .Visible = f...