VB程序中如何引用 Clipboard
我用vb写了个程序,其中要打开word把里面的内容复制到剪贴板,然后显示到页面上,可是编译总是不通过,说是没有声明Clipboard。错误为: BC30451: Name 'Clipboard' is not declared.
其中我的代码为<script language="vb" runat="server">
Sub Page_Load(sender as object,e as eventargs)
Dim temp
Dim wrdApp
Dim wrdDoc
Dim wrdSec
Clipboard.Clear
wrdApp = CreateObject("Word.Application")
wrdApp.visible = false
wrdDoc = wrdApp.Documents.Open("D:\1234.doc")
wrdSec = wrdApp.Selection
wrdSec.WholeStory
wrdSec.Copy
temp = Clipboard.GetText
result.value = temp
wrdDoc.Close
wrdApp.Quit
wrdApp = nothing
wrdSec = nothing
End Sub
</script>
网上查了好久,都是直接使用clipboard的,不用声明。现在我该怎么改?
[解决办法]
大家帮帮忙啊,弄了半天了