Calc link to Writer

Creating a macro - Writing a Script - Using the API

Calc link to Writer

Postby mouthon » Tue Jun 16, 2020 3:34 pm

Hello

Thomas, freshman into macros, i m here cause i m looking for help to improved my working experience on openoffice

I m really bad into coding MACROS, even if i understand and that i know how to manipulate them and work on them once they re written.

However for my work, i need to creat a CALC file linked to a WRITER. What i want is by completing the CALC files, every case i would filled, would be insert in existant portion of text at specifc places in my WRITER file. I also would like that via CALC or via WRITER to be able by pushing a button (non printable), to chose to show or hide some section of text/paragraphs.

As an example of what kind of files i work on is an attached file

XXXXXXX letters are my always existing text on the WRITER. This should not change whatever i do on the CALC file. The two action i m looking to macro is :

Surlined words represent the data to be filed in the CALC, and once the CALC filed, the data should apear in the gaps in the always existing text. Datas are simple something like NAME = ROGER, so ROGER get insert in the WRITER.

AJOUT 1, 2 and 3 represent text i would like to be able to show or hide at my convenience. Either by pushing the button i created in the grean sections (button 1 for AJOUT1, etc), or directly in CALC if it's easier. To be known that i have multiple green section with text i want to hide/show also inside each. But i guess once the work is done for one, shouldn't be a problem to adapt the lines to get it working for more.

I know it isn't an easy task or request, but it would really help me in my work as i generate so many files with different datas keeping the core text as a base. It would greatly increase my production.

I appreciate any help/explanation to help me create thos macros, and good sources to learn more on how to do so.

TY
Attachments
AIDE.odt
file as an example
(18.04 KiB) Downloaded 15 times
OpenOffice 4.1.7
Windows 10
mouthon
 
Posts: 4
Joined: Tue Jun 16, 2020 3:16 pm

Re: MACROS CALC link to WRITER

Postby Villeroy » Tue Jun 16, 2020 4:16 pm

Mail merge
Serial letter
Form letter
are synonyms for what you want to use.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: MACROS CALC link to WRITER

Postby RoryOF » Tue Jun 16, 2020 4:16 pm

Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31230
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: MACROS CALC link to WRITER

Postby mouthon » Tue Jun 16, 2020 5:21 pm

[SORRY DOUBLE POST]
Last edited by mouthon on Tue Jun 16, 2020 5:27 pm, edited 1 time in total.
OpenOffice 4.1.7
Windows 10
mouthon
 
Posts: 4
Joined: Tue Jun 16, 2020 3:16 pm

Re: MACROS CALC link to WRITER

Postby mouthon » Tue Jun 16, 2020 5:27 pm



This actually is exactly what i am looking for. but need to figure out how to make it work on the "database" now.

Last macro needed will be to show or hide some paragraph with buttons. TY so much!!
OpenOffice 4.1.7
Windows 10
mouthon
 
Posts: 4
Joined: Tue Jun 16, 2020 3:16 pm

Re: Calc link to Writer

Postby Villeroy » Tue Jun 16, 2020 11:01 pm

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: MACROS CALC link to WRITER

Postby Villeroy » Tue Jun 16, 2020 11:07 pm

mouthon wrote:Last macro needed will be to show or hide some paragraph with buttons. TY so much!!

No, things like "hidden text" or "conditional text" is standard functionality of a word processor.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc link to Writer

Postby JeJe » Wed Jun 17, 2020 1:18 am

To hide text, create a character style and toggle the font effects/hidden on or off depending.

Code: Select all   Expand viewCollapse view
thiscomponent.stylefamilies("CharacterStyles").getbyname(yourstylename).charhidden = true 'or false


Or you can do something similar with a paragraph style if its whole paragraphs, or use a section.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 1088
Joined: Wed Mar 09, 2016 2:40 pm

Re: Calc link to Writer

Postby mouthon » Wed Jun 17, 2020 2:24 am

You guys are freaking awesome. Looks like i got all the info needed. Now just need to assemble all the parts of the puzzle you gave me to do the job, i mean ig i m smart enough :)
OpenOffice 4.1.7
Windows 10
mouthon
 
Posts: 4
Joined: Tue Jun 16, 2020 3:16 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 5 guests