|
我想在WORD用VBA定制一个按钮,希望点击这个按钮后执行一个操作,但是这个操作不是
在本机上,而是在另一台服务器上,执行这个操作需要一段反应时间,我怎么才能让这个操作执行以后退出当前的窗口呢?而不是立即退出当前窗口,怎么改下面的代码?
Formid = ThisDocument.Application.CommandBars("Km2000").Controls(3).Caption
DocName = ThisDocument.Application.CommandBars("Km2000").Controls(8).Caption
'文件名
'MsgBox (DocName)
caps = Split(ThisDocument.Application.CommandBars("Km2000").Controls(4).Caption, ";")
'Url = caps(1) & "/dzzw/dboutdoc.nsf/" & ReplaceFormid & "?editdocument&" & Now()
Url2 = caps(1) & "/dzzw/dboutdoc.nsf/Attach?OpenAgent&DocId=" & Formid & "&docname=" & DocName
Msg = "您决定退出 ?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "退出提示"
Help = "DEMO.HLP"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
'MsgBox (Url2)
UserForm3.WebBrowser1.Navigate (Url2)
ThisDocument.Application.Quit SaveChanges:=False
Else
ThisDocument.ActiveWindow.Document.Activate
End If |
|