Ask Your Question
0

How to have variable in text document coming from a spreadsheet

asked 2018-08-30 12:26:00 +0100

ManuY gravatar image

I have a text document (a legal document) that uses a lot of time the same kind of words: - different names (document names, client names, etc.) - addresses - phone numbers

I would like to reference all these element in a spreadsheet and if the spreadsheet is updated I would like the text document reflects those changes throughout the document. I know how to do that with latex, however I cannot exchange a latex document with my collaborators, because they do not know how to use it.

I tried to include the value of a cell of the spreadsheet in the document as a value of formula or a variable like it is described in https://help.libreoffice.org/Calc/Ref... but it says: "expression is faulty".

Dos anyone has a idea how to perform such a task ?

edit retag flag offensive close merge delete

Comments

Quoting @ManuY: "I would like to reference all these elements in a spreadsheet and if the spreadsheet is updated I would like the text document reflects those changes throughout the document."
I didn' regard above statement much so far.
Seen this way you should surely keep and maintain the data inside the text document.

Lupp gravatar imageLupp ( 2018-08-30 19:01:57 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-08-30 15:18:27 +0100

Lupp gravatar image

updated 2018-08-31 19:17:16 +0100

You may play with the attached files. A very raw version of code you can use for the purpose is contained in the textfile. It only addresses the definition of variables for the text document based on the contents of a spreadsheet. Part of it goes back to a recorded macro.
Please note that a variable NOT gets disposed if the defining textfield is deleted. The variable must separately be killed.
How to define a variable without using a textfield I don't know.
I never used variables in text documents much.
TheTextDoc
TheSheetDoc

===Edit1:===
Since I considered your request a bit more, I would like to demonstrate to more detail how the data maintenance can be integrated into the document itself (prepared by the template).
The demo does not only show how to get new variables- but also how to update old ones.
However, it is by far not reliable enough to be used for everyday work. The comments I made on the 'tidyUp' Sub in the contained Basic code are essential.

New Demo

edit flag offensive delete link more

Comments

@Lupp Thanks a lot for the answer. For what I understand and try the link is not dynamic, if I update the spreadsheet, the text is not updated. That is the behaviour I was looking for. But maybe I can define a variable with a system similar to the macros you provided. Anyway it is a huge step forward towards the solution !

ManuY gravatar imageManuY ( 2018-08-30 16:37:31 +0100 )edit

There is no link. Every textfield is explicitly created in the text document.
You surely will create legal documents from templates. Based on my suggestion you may create the needed variables in a new document then. I know much to little about your actual needs to go farther and I couldn't afford the time anyway. Document automation isn't done casually. Precise specification and thorough implementation are indispensable.
You need to decide if you want to expend the time.

Lupp gravatar imageLupp ( 2018-08-30 18:47:02 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-08-30 12:26:00 +0100

Seen: 43 times

Last updated: Aug 31 '18