Calc rows to Writer paragraphs

Creating a macro - Writing a Script - Using the API

Calc rows to Writer paragraphs

Postby eschabichi » Fri Oct 27, 2017 6:18 pm

Hi,

I'm looking for a macro to copy the rows of a Calc spreadsheet to paragraphs in a Writer document. That is, each row in the sheet (or in a range of cells) becomes a paragraph. The cells within the row would be concatenated with a space between them. And in particular, formatting (bold, italics) must be maintained.

Does anyone have a similar macro?

I tried starting from https://forum.openoffice.org/en/forum/v ... 5&t=82224# which does much of this, but I had trouble modifying that macro to combine the cells of a row to paragraphs instead of just writing them to a table.

Thanks,
Joe
LibreOffice 5.1.6.2 on Ubuntu 16.04
eschabichi
 
Posts: 2
Joined: Fri Oct 27, 2017 5:27 pm

Re: Calc rows to Writer paragraphs

Postby Villeroy » Fri Oct 27, 2017 7:04 pm

menu>Table>Convert>Table to Text...
Specify a space as column delimiter
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25575
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc rows to Writer paragraphs

Postby eschabichi » Fri Oct 27, 2017 7:32 pm

Oh, you're saying to do that in Writer after running the macro I linked. That's a decent idea. I'd hoped to have finer control over the output even though I made it sound simpler in my question... I'll have to do a fair amount of cleanup in Writer... but this gets it most of the way there. Thanks Villeroy for your reply.
LibreOffice 5.1.6.2 on Ubuntu 16.04
eschabichi
 
Posts: 2
Joined: Fri Oct 27, 2017 5:27 pm

Re: Calc rows to Writer paragraphs

Postby Villeroy » Fri Oct 27, 2017 7:38 pm

Yes, I would expect that this dissolves the entire table structure while keeping all text attributes. I would also expect strange layouts where some cells contained line feeds.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25575
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests