Bug 119493

Summary: FILESAVE DOCX: Writer User Fields converted into plain text instead of Set variables
Product: LibreOffice Reporter: Oliver Brinzing <oliver.brinzing>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: enhancement CC: aron.budea, guido, oliver.brinzing, vmiklos
Priority: medium Keywords: filter:docx
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 88173, 112969    
Attachments: writer_test_userfield
writer_test_userfield.docx
writer_test_userfield_converted.docx

Description Oliver Brinzing 2018-08-25 14:20:11 UTC
Created attachment 144429 [details]
writer_test_userfield

steps to reproduce:
- create a new writer document
- insert a User Field (Ctrl+F2 -> Variables/User Field) 
  Name:  X_TEST 
  Value: Hello World!
  Format: Text

- save as *.odt
- save as *.docx
- User Field "X_TEST" with content "Hello World!" is
  exported as: "User Field X_TEST = Hello World!"
  -> read-/editing in word is difficult.

- save as *.doc results in text: "Hello World!"
  -> at least read-/editing in Word is possible

AFAIK User Fields are not supported in Word:
2.1.96 Part 1 Section 7.4.9, text:user-field-get
https://msdn.microsoft.com/en-us/library/jj670930(v=office.12).aspx

possible solution:
"OpenXML/ODF Translator Command Line Tools" from 
http://odf-converter.sourceforge.net/download.html 
converts UserFields into Set Variables.

attached a sample *.odt/*.docx and converted *.docx file
Comment 1 Oliver Brinzing 2018-08-25 14:20:54 UTC
Created attachment 144430 [details]
writer_test_userfield.docx
Comment 2 Oliver Brinzing 2018-08-25 14:21:17 UTC
Created attachment 144431 [details]
writer_test_userfield_converted.docx
Comment 3 Buovjaga 2018-09-20 09:33:14 UTC
Ok, I guess this can be seen as an enhancement of sorts.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 05db125c57ea3c8f04a304561209c32cc5c45a67
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on September 17th 2018
Comment 4 Xisco FaulĂ­ 2021-05-10 16:25:49 UTC
*** Bug 141471 has been marked as a duplicate of this bug. ***
Comment 5 Justin L 2022-04-01 05:59:50 UTC
This was fixed in LO 7.0 by Author: Miklos Vajna on Thu Jan 30 10:21:08 2020
with commit 676862bb8aa043f116615e5d0dac59254eaa8138
    DOCX export: implement support for user fields
    
    Updating the field doesn't work yet, that'll need additional markup in
    settings.xml.