Writer: how to use a DDE field in a condition

Discuss the word processor
Post Reply
heinrich_d
Posts: 5
Joined: Tue Dec 03, 2019 5:44 pm

Writer: how to use a DDE field in a condition

Post 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.
OpenOffice 4.1.7
Windows x86
User avatar
Zizi64
Volunteer
Posts: 11363
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

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

Post 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).
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Post 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)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
heinrich_d
Posts: 5
Joined: Tue Dec 03, 2019 5:44 pm

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

Post 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.)
OpenOffice 4.1.7
Windows x86
Post Reply