Page 1 of 1

Writer: how to use a DDE field in a condition

PostPosted: Thu Dec 05, 2019 2:01 am
by heinrich_d
I transfer a cell of a Calc-file to a document (writer file) using DDE.
This works perfect.
Now I try to use the DDE field in a condition to create a conditional text.
The DDE field contains a figure. The text shall be different depending on the value of the figure ( >=0).
This seems to be simple but I cannot find out how to do it.
Please help.

Re: Writer: how to use a DDE field in a condition

PostPosted: Thu Dec 05, 2019 8:50 am
by Zizi64
I transfer a cell of a Calc-file to a document (writer file) using DDE.


How you did it? By embedding a Calc file? Or some copy-paste?

Please upload two ODF type sample files here (the .ods one and the .odt one).

Re: Writer: how to use a DDE field in a condition

PostPosted: Thu Dec 05, 2019 11:12 am
by Villeroy
Do all the calculation in Calc and link the result to your DDE field.
=IF(X1>=0;"this text";"other text")
or
=IF(X1>=0;Y1;Z1)

Re: Writer: how to use a DDE field in a condition

PostPosted: Fri Dec 06, 2019 10:39 pm
by heinrich_d
Zizi64 wrote:
I transfer a cell of a Calc-file to a document (writer file) using DDE.


How you did it? By embedding a Calc file? Or some copy-paste?

Please upload two ODF type sample files here (the .ods one and the .odt one).



I used the menu of the document file:
Insert > Fields > Other > use Tab Variables > Select Type DDE-Field.
Insert a Name for the DDE-Field. Insert the DDE Statement e.g. soffice D:\folder\file.ods name_of_cell_in_calc_file. Use Format DDE automatic.
(The cell in the spread sheet is a named cell.)