刚搞出来! 一、光标停在你的123位置,点击插入->域->类别(选“文档自动化”,域名选“DocVariable”,新域名输入faname)->确定,即可在宏中加入以下代码 For Each aVar In ActiveDocument.Variables If aVar.Name = "faname" Then num = aVar.Index Next aVar If num = 0 Then ActiveDocument.Variables.Add Name:="faname", Value:=123 Else ActiveDocument.Variables(num).Value = 123 End If
'更改变量值,也可这样做,VB也太灵活了,也可向上面ELSE里面的那样做,搞不懂! ActiveDocument.Variables("faname") = "中国农业银行扬中市支行" '更新值 ActiveDocument.Fields.Update MsgBox ("Wait....") ActiveDocument.Variables("faname") = "电子银行部" ActiveDocument.Fields.Update 哈哈,还能实时更改你所需要的值 如有问题,请发到我邮箱:smzc@fjsm.net
[此贴子已经被作者于2006-2-23 9:52:55编辑过] |