9/12/25
MACROS IN LIBREOFFICE WRITER
---
1: Recording a Macro
To record a macro in LibreOffice Writer.
---
#Content to Type Before Recording
```
LibreOffice Writer is an open source word processor.
```
---
#Steps
1. Open LibreOffice Writer.
2. Click Tools → Macros → Record Macro.
3. Perform the following actions:
* Select the text.
* Click Bold.
* Change font size to 14.
4. Click Stop Recording.
5. Macro dialog box appears.
6. Save the macro as:
* Name: FormatText
* Location: My Macros → Standard → Module1
7. Click Save.
---
#Result
The macro is recorded successfully.
---
2: Running a Macro
To run a recorded macro.
---
#Steps
1. Type the following text:
```
Macros save time and reduce repeated work.
```
2. Select the text.
3. Click Tools → Macros → Run Macro.
4. Choose:
* My Macros → Standard → Module1 → FormatText
5. Click Run.
---
#Result
The macro is executed and the text is formatted automatically.
---
3: Creating and Organising a Simple Macro
To create and organize a simple macro.
---
#Steps
1. Click Tools → Macros → Organize Macros → LibreOffice Basic.
2. Select My Macros → Standard.
3. Click New Module.
4. Name the module as TextMacros.
5. Enter the following code:
```basic
Sub HelloMessage
MsgBox "Welcome to LibreOffice Writer"
End Sub
```
6. Click Save.
7. Close the editor.
---
#Running the Macro
1. Click Tools → Macros → Run Macro.
2. Select HelloMessage.
3. Click Run.
---
#Result
A message box is displayed on the screen.
---
4: Using Macro as a Function
To use a macro as a function.
---
#Steps
1. Open Tools → Macros → Organize Macros → LibreOffice Basic.
2. Create a new module.
3. Type the following code:
```basic
Function AddNumbers(a As Integer, b As Integer)
AddNumbers = a + b
End Function
```
4. Click Save.
---
#Using the Function
1. Go to Insert → Field → More Fields.
2. Select Functions → Macro.
3. Choose AddNumbers.
4. Enter values:
* a = 10
* b = 20
5. Click Insert.
---
#Result
The result 30 is displayed in the document.
---
=====================================================================
* Working with Templates *
1. What are templates?
Templates are pre-designed documents that contain formatting styles, text, and layouts. They help you create new documents quickly without designing everything from scratch.
2. How can you create a document using a predefined template?
-
Open LibreOffice Writer
-
Go to File → New → Templates
-
Choose a template from the list
-
Click Open → A new document is created using that template.
3. Suppose you have made some changes in a template. What will you do to update the same changes in the document based on that template?
You need to update and save the template again. When the template is modified, documents created from that template can be updated by reloading the styles from the template using Update Styles.
4. What is the difference between Accept Track Change and Accept All Tracked Changes buttons?
-
Accept Track Change → Accepts only the currently selected change.
-
Accept All Tracked Changes → Accepts all changes in the entire document at once.
5. Explain the various options of the Track Changes toolbar.
The main options are:
-
Show/Hide Track Changes → Displays or hides changes.
-
Accept or Reject Changes → Approves or discards changes.
-
Previous / Next Change → Moves through the changes one by one.
-
Comments → Allows adding or reviewing comments.
6. How are comments inserted in a document?
-
Place the cursor where you want to add a comment.
-
Go to Insert → Comment (or right-click and choose Insert Comment).
-
A comment box appears in the margin where you can type your note.
7. What is the difference between importing and exporting a template?
-
Importing a template → Bringing a template from another location (like a USB or another computer) into LibreOffice.
-
Exporting a template → Saving or sending a template from LibreOffice to another location so it can be used elsewhere.