https://bugs.documentfoundation.org/show_bug.cgi?id=150267

            Bug ID: 150267
           Summary: FILEOPEN DOCX RTF Unused document variable not
                    imported
           Product: LibreOffice
           Version: 7.5.0.0 alpha0+ Master
          Hardware: All
               URL: https://support.microsoft.com/en-us/topic/how-to-store
                    -and-retrieve-variables-in-word-documents-3a912a35-42a
                    0-7a28-7f2d-787ed6afb566
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 181587
  --> https://bugs.documentfoundation.org/attachment.cgi?id=181587&action=edit
Example file from Word 2016 with a macro setting two variables

Attached document 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 saved as DOCX or RTF and opened in Writer, the Unused
variable is not imported, and so it would be lost upon save as well.

1, Open attached docx, rtf files 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, rtf files 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.

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 86b2bfd34a4f07c54f03c8c8dfe48e0810834628
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to