joe*_*joe 14 ms-word docvariable
什么是DOCVARIABLE
Microsoft Word 2003?我该如何设置?如何在Word文档中显示它?
您可以使用Microsoft Visual Basic for Applications Variables集合来设置和检索Word文档或模板中的字符串变量的内容.
此外,在将文档变量设置为在Word文档中显示后,可以使用DocVariable字段检索文档变量的值.
Sub GetSetDocVars()
Dim fName As String
fName = "Jeff Smith"
' Set contents of variable "fName" in a document using a document
' variable called "FullName".
ActiveDocument.Variables.Add Name:="FullName", Value:=fName
' Retrieve the contents of the document variable.
MsgBox ActiveDocument.Variables("FullName").Value
End Sub
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
30639 次 |
最近记录: |