|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 duquancai 于 2017-6-3 22:02 编辑
隐藏答案 自己去完成》》》》》》》
Sub 计算答案()
Dim str$, D As Object, W As Object
Set D = CreateObject("HTMLFILE"): Set W = D.parentWindow
D.write "<Script></Script>"
sr$ = "0123456789++--"
With ActiveDocument.Range(0, 0)
Do While .MoveUntil("=")
.MoveStartWhile sr, wdBackward
str = Replace(Replace(.Text, "+", "+"), "-", "-")
.Collapse 0: .Move , 1
.Text = W.eval("" & str & ""): .Collapse 0
Loop
End With
End Sub
|
|