Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在DOCVARIABLE 没有VBA 的情况下创建(和显示)多行?即 "One\r\nTwo\r\nThree" 呈现为 One Two Three
DOCVARIABLE
One Two Three
请尝试以下方法:
{ 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