Hi everyone,
In a macro using the language Basic, I would like to get / retrieve the current paragraph style, save it to a variable, and, at a later stage in the macro, apply that style.
Does anyone know if that's possible - and if yes, how?
Thank you,
Fab
[Solved] Get current paragraph style and apply later
-
- Posts: 4
- Joined: Wed Feb 01, 2012 11:31 pm
[Solved] Get current paragraph style and apply later
Last edited by helpnewbie on Wed May 02, 2012 9:49 pm, edited 1 time in total.
Re: Macro get current paragraph style - and apply later
You can get the name of the Paragraph Style at the current location of the view cursor with
and you can apply that style at another location using either the View Cursor or a Text Cursor by setting the ParaStyleName property
Code: Select all
StyleName = ThisComponent.CurrentController.ViewCursor.ParaSytleName
Code: Select all
oCursor.ParaStyleName = StyleName
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
-
- Posts: 4
- Joined: Wed Feb 01, 2012 11:31 pm
Re: Macro get current paragraph style - and apply later
Thank you!
Windows, OpenOffice 3.3.0, LibreOffice 3.4.5