标签: ms-word docvariable
有没有办法在没有 VBA的情况下创建(并显示)多行DOCVARIABLE ? 即"一个\ r \ nTwo \ r \ nThree"渲染成 One Two Three
DOCVARIABLE
One Two Three
答案 0 :(得分:0)
请尝试以下方法:
{ DOCVARIABLE TestVar \* MERGEFORMAT } Sub DocVars() Dim arr As Variant, joinSting As String arr = Array("One", "Two", "Three", "Four", "Five") joinSting = Join(arr, vbNewLine) ActiveDocument.Variables("TestVar").Value = joinSting End Sub