Heading 1 add <h1> and </h1>

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
P07
Posts: 1
Joined: Tue Sep 28, 2021 9:01 am

Heading 1 add <h1> and </h1>

Post by P07 »

Please, how do I use a macro to add <h1> and </h1> tags to Heading 1?
OpenOffice 4.1.10 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34610
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Heading 1 add <h1> and </h1>

Post by RoryOF »

Save As in HTML format (you will need to scroll the formats down to find that). Be aware that OpenOffice does not write good HTML code. You might be better searching for and using a dedicated HTML editor.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2778
Joined: Wed Mar 09, 2016 2:40 pm

Re: Heading 1 add <h1> and </h1>

Post by JeJe »

Do a find/replace with search for styles to select all Heading 1 paragraphs then do a regex search upon that selection for

^(.+)$

Replacing with

<h1>&</h1>

If it has to be a macro use macro record to get the code.

Edit: Corrected replace term.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply