Hi Forum Folke,
Perhaps a naive question, but: is it possible to create a keyboard macro (such as CTRL+ALT+F3) or something like that (a 'la 'word perfect') so I can frequently shift back and forth between several different types of paragraph styles?
My intended document consists of emails (left-justified, but with indented edges on each side, so it forms a 'column' centered in the page), texts from (left justified up against left margin, but restricted to left 2/3 of page, and enclosed in a yellow callout balloon), texts to (left justified, but starting about a third of a page from the left margin, and ending at the right margin, enclosed in a blue callout balloon), and default (but center justified) text.
I have been jumping back and forth from the "styles and formatting" floating toolbar, but I have to scroll up and down the entire list of styles to find the ones I am constantly using. It's do-able, but highly tedious. I'd like to create four (at least) key combinations that will do this quickly... or is there a way to get the "styles and formatting" toolbar to show only those styles I'm actually using?
Thanks in advance, and apologies if I've posted this question in the wrong place!
Using macro to switch styles back and forth?
Using macro to switch styles back and forth?
OpenOffice 4.1.6. on Windows 10 (ecchhh!) and Linux Mint
Re: Using macro to switch styles back and forth?
At the bottom of the Styles and Formatting dialog there is a drop down list. It probably says All Styles in your case. You can set that to Applied Styles and show only the styles you are using.
It is also possible to map styles to key board combinations. Select the menu item Tools -> Customize and choose the Keyboard tab. At the bottom left, scroll down the Category list to find Styles. Expand the Styles list and choose Paragraph. Choose the desired style from the Function list. You can then choose a key combination from the list of those and click Modify to assign it.
It is also possible to map styles to key board combinations. Select the menu item Tools -> Customize and choose the Keyboard tab. At the bottom left, scroll down the Category list to find Styles. Expand the Styles list and choose Paragraph. Choose the desired style from the Function list. You can then choose a key combination from the list of those and click Modify to assign it.
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.
Re: Using macro to switch styles back and forth?
You can also name your custom styles so they start with the letter A and appear at the top of the list.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Using macro to switch styles back and forth?
if you want something like a keypress that switches between a sequence of styles - (screenwriting software typically use the tab key for this) then this is a macro for that. You'd need to change the style names to yours and set a shortcut to the macrol
Code: Select all
Sub changestyle
dim sname,newst as string
on error goto hr
sname = ThisComponent.CurrentController.ViewCursor.ParaStyleName
Select Case sname
Case "Description"
newst = "SLUG"
CASE "SLUG"
newst = "CHARACTER"
case "CHARACTER"
newst = "Parenthesis"
CASE "Parenthesis"
newst = "Dialogue"
case "Dialogue"
newst = "Description"
end select
if newst <> "" then
ThisComponent.CurrentController.ViewCursor.ParaStyleName = newst
end if
hr:
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Using macro to switch styles back and forth?
Thank you All for your replies!
@FJCC... that sounds exactly like what I want to do! Thanks so much for the directions!
@JeJe... I've used that trick elsewhere... using a leading "." or letter or some other character to force it to the top of a list. Don't know why that didn't occur to me here. I also like your code, but that's well above my pay grade. I've been using these things since the '286-12 with a whopping 1mb of RAM and a 40 mb hard drive, running DOS 3.3 was considered killer hardware... but I've never learned how to code. Not even Basic. My mind just isn't wired for it... all it does is generate a bunch of frustration, and who needs that? My talents lie elsewhere. I like the idea, but I wouldn't know which term to alter and what to not touch.
@FJCC... that sounds exactly like what I want to do! Thanks so much for the directions!
@JeJe... I've used that trick elsewhere... using a leading "." or letter or some other character to force it to the top of a list. Don't know why that didn't occur to me here. I also like your code, but that's well above my pay grade. I've been using these things since the '286-12 with a whopping 1mb of RAM and a 40 mb hard drive, running DOS 3.3 was considered killer hardware... but I've never learned how to code. Not even Basic. My mind just isn't wired for it... all it does is generate a bunch of frustration, and who needs that? My talents lie elsewhere. I like the idea, but I wouldn't know which term to alter and what to not touch.
OpenOffice 4.1.6. on Windows 10 (ecchhh!) and Linux Mint