kendallbp
kendallbp

Reputation: 161

How to insert line breaks in strings

How to insert line breaks when writing macros in libreoffice calc?

e.g:

oCell.SetString("hello /? world!")

Out:

hello
world!

Upvotes: 1

Views: 2738

Answers (1)

Jim K
Jim K

Reputation: 13820

As explained in the help docs at Inserting Line Breaks in Cells, a line break in Calc is ASCII 10. So use the Chr function.

oCell.setString("Hello" & Chr(10) & "world!")

P.S. to JohnSUN, who wrote this example: We are praying for you and those close to you during this difficult time.

Upvotes: 3

Related Questions