This is a followup to bug 150267 DOCX attachment 181588 [details] has set two document variables from VBA macro: ActiveDocument.Variables.Add Name:="FullName", Value:=fName ActiveDocument.Variables.Add Name:="Unused", Value:=VarUnused Of these FullName is inserted into the document as a field, Unused is not. When this document is opened in Writer, the Unused variable is not imported. STR: 1, Open attachment 181588 [details] in Word 2, Run the following macro: Sub GetDocVars() MsgBox ActiveDocument.Variables("FullName").Value & " " & ActiveDocument.Variables("Unused").Value End Sub This will show there are two document variables defined. 3, Open the docx file in Writer, go to the Fields dialog (Ctrl-F2), Variables tab. 4, Under User Field there is only the FullName variable listed with the correct Jeff Smith value. Expected: the Unused field is also imported with the "Hello World" value.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/992d86b1b67a6bd28bbf5e63b2d2406881f476b7 tdf#150542: DOCX import: support for document varibles It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/184a805bc50c593cde950fb0b3253665cc748999 tdf#150542: DOCX import: support for document varibles It will be available in 7.5.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: c4a58634753a84b09f20f7271d6525a6656522d3 CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: en-US (hu_HU); UI: de-DE Calc: threaded Now the "Unused" variable is visible in the Fields dialog. Also survives changing its value and saving to docx. Adding a new one in the Fields dialog and saving to docx is also working. Such changes are correctly appearing in Word too.