为什么下面这句代码粘贴到代码窗口编译可以正确执行,而用ScriptControl控件执行却提示:
C:\.........\1.chm 不是 Windows 帮助文件,或者该文件已被破坏。x = MsgBox ("内容",16384,"标题","1.chm","100")

解决方案 »

  1.   

    shell("hh c:\1.chm"),vbnormalfocus
      

  2.   

    使用ScriptControl控件时,CHM文件需路径。
      

  3.   

    都没有我要的结果,可能大家对ScriptControl控件不熟悉?而不明白我的意思?
      

  4.   


    Option Explicit
        
      Private Sub Command1_Click()
      ScriptControl1.Language = "VBScript"
      ScriptControl1.AddCode (Text1.Text)
      ScriptControl1.Run ("Test")
      End Sub
    将下列代码拷到Text1,单击Command1
    sub   Test()
    x = MsgBox ("内容",16384,"标题","1.chm","100")
    end   sub
      

  5.   

    前面测试没看清楚,8楼给的代码还是会出现我上面我提到的问题,老是提示:1.chm 不是 Windows 帮助文件,或者该文件已被破坏。但是将代码复制到代码窗口运行又是好好的.该如何实现带帮助按钮和帮助文件的MsgBox 函数语句能在ScriptControl控件正确执行呢?