Automation中經(jīng)常需要程序和剪切板交互,還在使用鍵盤(pán)一個(gè)一個(gè)input??jī)?nèi)容多的話,豈不是太慢了,使用剪切板的黏貼復(fù)制,so fast,so easy……具體需要調(diào)用Microsoft Forms 2.0 Object Library的對(duì)象和方法,用它輕松實(shí)現(xiàn)設(shè)置和獲取剪切板的內(nèi)容,下面寫(xiě)了2個(gè)設(shè)置和獲取剪切板內(nèi)容的函數(shù),需要的時(shí)候直接調(diào)用~
'operating clipboard Function setClipboard(str) 'setting clipboard's content Dim Form, TextBox Set Form = CreateObject("Forms.Form.1") Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object TextBox.MultiLine = True TextBox.Text = str TextBox.SelStart = 0 TextBox.SelLength = TextBox.TextLength TextBox.Copy End Function Function getClipboard 'getting clipboard's content Dim Form, TextBox Set Form = CreateObject("Forms.Form.1") Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object TextBox.MultiLine = True If TextBox.CanPaste Then TextBox.Paste getClipboard = TextBox.Text End If End Function
更多方法參考鏈接:http://demon.tw/programming/vbs-clipboard.html
網(wǎng)頁(yè)題目:VBScript設(shè)置和獲取剪切板內(nèi)容的方法-創(chuàng)新互聯(lián)
文章分享:http://sd-ha.com/article18/dcepdp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開(kāi)發(fā)、網(wǎng)站內(nèi)鏈、網(wǎng)站導(dǎo)航、定制開(kāi)發(fā)、定制網(wǎng)站、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容